Copy link to clipboard
Copied
Hello,
I would like to run a method which returns an array on opening the pdf file. Then I would like to access the returned array from different buttons.
How can I do it?
Copy link to clipboard
Copied
If you define the variable at the doc-level (not inside a function), it should be available to all other code later on.
Copy link to clipboard
Copied
But how?
Copy link to clipboard
Copied
Doc-level script:
var a = "abc";
Button-level script:
app.alert(a);
Copy link to clipboard
Copied
I don't need to use global?
And where do I write the Doc level script, in order to let it reun on opening the file?
Copy link to clipboard
Copied
No.
All doc-level scripts are executed when the file is opened. You can add them under Tools - JavaScript - Document JavaScripts.
Copy link to clipboard
Copied
I am using adobe acrobat 8 3D version.
It is under advanced> document processing> document javascripts
However it lets me add only functions.
It opens the JavaScript Functions window....
Copy link to clipboard
Copied
Delete the default code and add your code instead. It doesn't have to be inside a function.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now