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

Javascript : document actions

New Here ,
Apr 14, 2020 Apr 14, 2020

how to add acrobat javascript to set document actions automatically.

I would like to add javascript to "document will save" action in document action menu of Acrobat automatically. 

Any guidance will be much appreciated.

 

 

Thank you,

Nivi

TOPICS
Acrobat SDK and JavaScript
332
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 ,
Apr 14, 2020 Apr 14, 2020

You can do it using the setAction method of the Document object, like this:

this.setAction("WillSave", "app.alert(\"The file has been saved.\",3);");

 

Note the second parameter includes the script to execute, but in the form of a String.

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 ,
Apr 22, 2020 Apr 22, 2020
LATEST

Thank you very much

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 ,
Apr 14, 2020 Apr 14, 2020

When in doubt, check the reference:

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_Acro...

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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