3
Acrobat JavaScript Contexts
Summary
Summary
Acrobat JavaScripts can be applied either within a document or outside a document. Inside
a document, scripts can be created so that they are visible throughout the document
(document level JavaScripts), or visible only to a given form field within the document
(field-level JavaScripts). Outside a document, scripts can be created so that they provide
generally useful functions or variables available to all documents (folder level JavaScripts),
or they can be created for the purpose of processing a collection of documents (batch level
JavaScripts).
The decision to place a JavaScript at a given level is based on its general applicability. If a
script is to have a specialized function applicable to a single component within a
document, it would be appropriate to create a field level JavaScript. If a script would be
generally useful to several form fields within a document, it would be appropriate to create
a document level JavaScript. If a function or variable can be used in a variety of situations
within many documents, it would be appropriate to create a folder level JavaScript.
66
Acrobat JavaScript Scripting Guide