Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Javascript Identity su Pdf

New Here ,
Mar 13, 2023 Mar 13, 2023

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.

 

script_java.jpgexpand imagedebugger.jpgexpand image

TOPICS
JavaScript , PDF forms
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Mar 13, 2023 Mar 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

 

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 13, 2023 Mar 13, 2023

Where does you use the script?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 13, 2023 Mar 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

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 30, 2023 Mar 30, 2023
LATEST

Risolto! 

Non conoscevo gli script di cartella e relative funzioni privilegiate.

Grazie.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 14, 2023 Mar 14, 2023

Answer is in the JavaScript for Acrobat API Reference:

 

Capture_2303141140.pngexpand image


Acrobate du PDF, InDesigner et Photoshoptographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines