1
Acrobat JavaScript Overview
Acrobat JavaScript Introduction
Acrobat JavaScript Introduction
Most people know Acrobat as a medium for exchanging and viewing electronic documents
easily and reliably, independent of the environment in which they were created. However,
Acrobat provides far more capabilities than a simple document viewer.
You can enhance a PDF document so that it contains form fields to capture user-entered
data as well as buttons to initiate user actions. This type of PDF document can replace
existing paper forms, allowing employees within a company to fill out forms and submit
them via PDF files, and connect their solutions to enterprise workflows by virtue of their
XML-based structure and the accompanying support for SOAP-based Web Services.
Acrobat also contains functionality to support
online team review.
Documents that are
ready for review are converted to PDF. When a reviewer views a 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 security policies, interact
with databases and web services, and dynamically 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 form field or button in 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 Acrobat itself. 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 language like
C or C++. Now, much of that same functionality is available through Acrobat JavaScript
extensions. You will find that using Acrobat JavaScript to perform a task such as adding a
menu to Acrobat’s user interface is much easier to do than writing a plug-in.
Acrobat JavaScripts can be created for batch processing of multiple documents, processing
within a single document, processing for a given page, and processing for a single form
field. For batch processing, it is possible to execute JavaScript on a set of PDF files, which
enables tasks such as extracting comments from a comment repository, identifying
spelling errors, and automatically printing PDF files.
20
Acrobat JavaScript Scripting Guide