Skip to main content
Participant
Apr 14, 2020 10:41 AM UTC
Question

Javascript : document actions

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

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Thom Parker
Community Expert
Community Expert
Apr 14, 2020 4:45 PM UTC
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
Apr 14, 2020 10:52 AM UTC

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
nivedithaAuthor
Participant
Apr 22, 2020 4:57 PM UTC

Thank you very much

Translate