Skip to main content
Participant
March 13, 2023
Answered

Javascript Identity su Pdf

  • March 13, 2023
  • 3 replies
  • 1264 views

Dovrei utilizzare dei Javascript su un PDF richiamando le funzioni “identity.loginName” e “this.saveAs” ma ho dei problemi di autorizzazioni: a volte vanno a volte no.

Ho impostato le stesse preferenze sui due Acrobat. Sembra quasi che il creatore/proprietario del pdf possa utilizzare queste proprietà, mentre se passo il file ad un'altra persona questa non ne abbia il permesso.

 

This topic has been closed for replies.
Correct answer try67

> sometimes they go sometimes not

That's impossible. Either it works, or it doesn't. If it works in some cases and not others that means you're running the code from different contexts, with different levels of privilege. For example, code that is executed from the JS Console is considered trusted by default, while code that is executed from a field (such as a button's Mouse Up event) is not. Both the Identity object and the saveAs method require a trusted context to work.

See here: https://acrobatusers.com/tutorials/trust-and-privilege-in-acrobat-scripts

https://acrobatusers.com/tutorials/using_trusted_functions

 

3 replies

JR Boulay
Community Expert
Community Expert
March 14, 2023

Answer is in the JavaScript for Acrobat API Reference:

 

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
March 13, 2023

> sometimes they go sometimes not

That's impossible. Either it works, or it doesn't. If it works in some cases and not others that means you're running the code from different contexts, with different levels of privilege. For example, code that is executed from the JS Console is considered trusted by default, while code that is executed from a field (such as a button's Mouse Up event) is not. Both the Identity object and the saveAs method require a trusted context to work.

See here: https://acrobatusers.com/tutorials/trust-and-privilege-in-acrobat-scripts

https://acrobatusers.com/tutorials/using_trusted_functions

 

Participant
March 30, 2023

Risolto! 

Non conoscevo gli script di cartella e relative funzioni privilegiate.

Grazie.

Bernd Alheit
Community Expert
Community Expert
March 13, 2023

Where does you use the script?