How/where to declare a document level global variable in Acrobat?
Creating a global variable when writing JavaScript in a file is is straight forward and obvious, but not when trying to set it in Acrobat via the Use JavaScript tool in Acrobat. I have read:
- Document Level (Document Open) Scripts (https://www.pdfscripting.com/public/Document-Level-Scripts.cfm)
It is obvious that the Document javascripts strings tool is the place to enter JavaScript functions, as many as required can be added and are visible using the All javascript strings tool:
//<Document-Level>
//<ACRO_source>foo</ACRO_source>
//<ACRO_script>
/*********** belongs to: Document-Level:foo ***********/
function foo()
{
console.println("Hello, world!");
}
//</ACRO_script>
//</Document-Level>The added function is shown in the Scripts pane of the Javascript Debugger window indicating that Acrobat sees them.
However, it isn't obvious how to create a document global variable. When I add them manually to the All javascripts strings/Javascript Editor and close, the variable is lost as in it is not there when the Editor is opened again. As the functions are enclosed in <ACRO></ACRO> tags, it may that there are tags for the document level variables? If so, what are they? I assume that when a document level variable is created, it will be displayed in the Inspect pane of the JavaScript Debugger window because Variable/Value are shown in the header.
