Copy link to clipboard
Copied
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.
> 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
...Copy link to clipboard
Copied
Where does you use the script?
Copy link to clipboard
Copied
> 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
Copy link to clipboard
Copied
Risolto!
Non conoscevo gli script di cartella e relative funzioni privilegiate.
Grazie.
Copy link to clipboard
Copied
Answer is in the JavaScript for Acrobat API Reference: