Introduction to Acrobat JavaScript
What Is Acrobat JavaScript?
1
12 Acrobat JavaScript Scripting Guide
PDF document is referred to as an eForm. eForms are integral to an automated paper
document processing solution for a company. In this scenario, eForms can replace existing
paper forms, allowing employees within a company to fill out forms and submit them via
PDF files.
Acrobat also contains functionality to support online team review. Documents that are
ready for review are converted to Adobe PDF. When a reviewer views an Adobe PDF
document in Acrobat and adds comments to it, those comments (or annotations)
constitute an additional layer of information on top of the base document. Acrobat
supports a wide variety of standard comment types, such as a note, graphic, sound, or
movie. To share comments on a document with others, such as the author and other
reviewers, a reviewer can export just the comment "layer" to a separate comment
repository.
In either of these scenarios, as well as others that are not mentioned here, you can
customize the behavior of a particular PDF document, implement additional functionality
beyond what Acrobat provides, and alter the appearance of a PDF document by using
Acrobat JavaScript. You can tie Acrobat JavaScript code to a specific PDF document, a
particular page within a PDF document, or a field or button on a PDF file. When an end user
interacts with Acrobat or a PDF file displayed in Acrobat that contains JavaScript, Acrobat
monitors the interaction and executes the appropriate JavaScript code.
Not only can you customize the behavior of PDF documents in Acrobat, but you can
customize the Acrobat application. In earlier versions of Acrobat (prior to Acrobat 5), this
type of customization could only be done by writing Acrobat plug-ins in a high-level
languge like C or C++ language. Now, much of that same functionality is available through
Acrobat JavaScript extensions. You will find that writing a JavaScript script to perform a task
such as adding a menu to Acrobat’s user interface much easier to do than writing a plug-in.
What Is Acrobat JavaScript?
Acrobat JavaScript is based on the core of JavaScript version 1.5 of ISO-16262, formerly
known as ECMAScript. JavaScript is an object-oriented scripting language developed by
Netscape Communications. It was created to offload Web page processing from a server
onto a client in Web-based applications. Acrobat JavaScript implements extensions, in the
form of new objects and their accompanying methods and properties, to the JavaScript
programming language. These Acrobat-specific objects enable a developer to manipulate
a PDF file, allowing the PDF file to communicate with a database, modify its appearance,
and so on. Because the Acrobat-specific objects are added on top of core JavaScript, you
still have access to standard classes like Math, String, Date, Array, and RegExp.
PDF documents have great versatility since they can be displayed in a Web browser via an
Acrobat plug-in. In this situation, you need to be aware that there are differences between
Acrobat JavaScript and JavaScript used in a Web browser, also known as HTML JavaScript.
● Acrobat JavaScript does not have access to objects within an HTML page. Similarly,
HTML JavaScript cannot access objects within a PDF file.