beautypg.com

Working with javascript in acrobat – Adobe Acrobat 7 Professional User Manual

Page 710

background image

Working with JavaScript in Acrobat

The JavaScript language was developed by Netscape Communications so you can more
easily create interactive web pages. Adobe has enhanced JavaScript so that you can easily
integrate this level of interactivity into your PDF documents. JavaScript can perform
calculations, respond to user actions, validate user data, process multiple PDF documents
in batch sequences, and control the behavior of the document. You can invoke JavaScript
code in the following ways:

Using Page Open and Page Close actions. For example, you may want to update a date on
a page. (See

Using actions for special effects

.)

Using Document Actions to create document-level JavaScript actions that apply to the
entire document. For example, selecting Document Did Save runs the JavaScript after a
document is saved.

Using bookmarks or links. (See

Adding page actions with page thumbnails

and

Adding

actions to a link

.)

Using form fields. The most common uses for JavaScript in Acrobat forms are formatting
data, calculating data, validating data, and assigning an action. Field-level scripts are
associated with a specific form field or fields, such as a button.This type of script is
executed when an event occurs, such as a Mouse Up action. (See

Creating interactive

buttons

.)

Opening scripts directly from the JavaScripts folder on your hard drive.

To learn how to create JavaScript scripts, download the JavaScript manuals from the
Adobe website. The Acrobat JavaScript Scripting Guide contains background information
and tutorials, and the Acrobat JavaScript Scripting Reference contains detailed reference
information. These and other JavaScript resources are located at http://partners.adobe.com/
asn/acrobat/index.jsp (English only).

This manual is related to the following products: