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

Javascript Identity su Pdf

New Here ,
Mar 13, 2023 Mar 13, 2023

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.

 

script_java.jpgdebugger.jpg

TOPICS
JavaScript , PDF forms

Views

812

Translate

Translate

Report

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

correct answers 1 Correct answer

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

...

Votes

Translate

Translate
Community Expert ,
Mar 13, 2023 Mar 13, 2023

Copy link to clipboard

Copied

Where does you use the script?

Votes

Translate

Translate

Report

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

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

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Risolto! 

Non conoscevo gli script di cartella e relative funzioni privilegiate.

Grazie.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Answer is in the JavaScript for Acrobat API Reference:

 

Capture_2303141140.png

Votes

Translate

Translate

Report

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