1
Acrobat JavaScript Overview
Acrobat JavaScript Object Summary
app
The
app
object is a static object that represents the Acrobat application itself. It offers a
number of Acrobat-specific functions in addition to a variety of utility routines and
convenience functions. By interacting with the
app
object, you can open or create PDF and
FDF documents, and customize the Acrobat interface by setting its viewing modes,
displaying popup menus, alerts, and thermometers, displaying a modal dialog box,
controlling time intervals, controlling whether calculations will be performed, performing
email operations, and modifying its collection of toolbar buttons, menus, and menu items.
You can also query
app
to determine which Adobe product and version the end user is
using (such as Reader 6.0 or Acrobat Professional 7.0), as well as which printer names and
color spaces are available.
doc
The
doc
object is the primary interface to the PDF document, and it can be used to access
and manipulate its content. The
doc
object provides the interfaces between a PDF
document open in the viewer and the JavaScript interpreter. By interacting with the
doc
object, you can get general information about the document, navigate within the
document, control its structure, behavior and format, create new content within the
document, and access objects contained within the document, including bookmarks, form
fields, templates, annotations, and sounds.
F
IGURE
1.1
Doc Object Containment Hierarchy
doc
annot
field
sound
bookmark
template
data
Figure 1.1
represents the containment hierarchy of objects related to the
doc
object.
Accessing the
doc
object from JavaScript can be done in a variety of ways. The most
common method is using the
this
object, which is normally equivalent to the
doc
object
of the current underlying document.
22
Acrobat JavaScript Scripting Guide