Home
Acrobat JavaScript Scripting Guide
Adobe Acrobat 7.0
Contents
  Preface
    Introduction
      What is Acrobat JavaScript?
      Audience
      Purpose and Scope
      Assumptions
    How To Use This Guide
    Font Conventions Used in This Book
    Related Documents
  Acrobat JavaScript Overview
    Introduction
      Chapter Goals
      Contents
    Acrobat JavaScript Introduction
    Acrobat JavaScript Object Summary
      app
      doc
      dbg
      console
      global
      Util
      dialog
      security
      SOAP
      search
      ADBC
      event
    What Can You Do with Acrobat JavaScript?
  Acrobat JavaScript Tools
    Introduction
      Chapter Goals
      Contents
    Using the Acrobat JavaScript Console
      Opening the JavaScript Console
      Executing JavaScript
      Formatting Code
    Exercise: Working with the JavaScript Console
      Enabling JavaScript
      Trying out the JavaScript Console
    Using a JavaScript Editor
    Specifying the Default JavaScript Editor
    Using the Built-in Acrobat JavaScript Editor
    Using an External Editor
      Additional Editor Capabilities
      Specifying Additional Capabilities to Your Editor
      Testing Whether Your Editor Will Open at Syntax Error Locations
        Saving and Closing a File with a Syntax Error
    Using the Acrobat JavaScript Debugger
    Acrobat JavaScript Debugger
      Main Groups of Controls
      Debugger View Windows
    Debugger Buttons
      Resume Execution
      Interrupt
      Quit
      Step Over
      Step Into
      Step Out
    Debugger Scripts Window
      Accessing Scripts in the Scripts Window
      Scripts Inside PDF Files
      Scripts Outside PDF Files
    Call Stack List
    Inspect Details Window
      Inspect Details Window Controls
      Inspecting Variables
      Watches
      Breakpoints
        Coding Styles and Breakpoints
        Listing Breakpoints
        Using Conditional Breakpoints
    Starting the Debugger
      Debugging From the Start of Execution
        Debug From Start
        Click Interrupt
      Debugging From an Arbitrary Point in the Script
        Define a Breakpoint
        Using the debugger keyword
    Exercise: Calculator
      Calculator
        How the Calculator Displays Output
        Values With More Than 1 Digit
        Testing the Calculator
    Summary
  Acrobat JavaScript Contexts
    Introduction
      Chapter Goals
      Contents
    Introduction to Acrobat JavaScript Contexts
    Folder Level JavaScripts
    Document Level JavaScripts
    Field Level JavaScripts
    Batch Level JavaScripts
    Summary
  Creating and Modifying PDF Documents
    Introduction
      Chapter Goals
      Contents
    Creating and Modifying PDF Files
      Combining PDF Documents
      Creating PDF Files from Multiple Files
      Cropping and Rotating Pages
        Cropping Pages
        Rotating Pages
      Extracting, Moving, Deleting, Replacing, and Copying Pages
      Adding Watermarks and Backgrounds
      Adding Headers and Footers
    Converting PDF Documents to XML Format
  Print Production
    Introduction
      Chapter Goals
      Contents
    Print Production
      Printing PDF Documents
      Silent Printing
      Printing Documents with Layers
      Setting Advanced Print Options
        Specifying Output Settings
        Specifying Marks and Bleeds
        Setting PostScript Options
        Setting Font Options
  Using Acrobat JavaScript in Forms
    Introduction
      Chapter Goals
      Contents
    Forms Essentials
      Introduction
      About PDF Forms
        Types of PDF Forms
        Elements of Acrobat Forms
        Guidelines for Creating a New Form
      Creating Acrobat Form Fields
      Setting Acrobat Form Field Properties
        Format Options
        Button Properties
        Checkbox Properties
        Combo Box Properties
        Listbox Properties
        Radio Button Properties
        Signature Properties
        Text Field Properties
        Validation Options
        Calculation Options
        Highlighting Required Form Fields
        Alerting Users Automatically for Required Form Fields
      Making a Form Fillable
        Enabling Typing
      Setting the Hierarchy of Form Fields
      Creating Forms From Scratch
        Positioning Form Form Fields
        Duplicating Form Fields
        Creating Multiple Form Fields
        Creating Form Fields That Span Multiple Pages
        Defining the Tabbing Order
        Defining Form Field Calculation Order
      Making PDF Forms Web-Ready
        Creating Submit Buttons
        Creating Reset Form Buttons
        Creating Import Data Buttons
        Defining CGI Export Values
      Using Custom JavaScripts in Forms
      Introduction to XML Forms Architecture (XFA)
        Enabling Dynamic Layout and Rendering
        Growable Form Fields
        Variable-Size Rows and Tables
        Multiple Customized Forms within a Form Based on User Input
        Handling Image Data
        Dynamic Tooltips
        XFA-Specific JavaScript Methods
        JavaScript Methods Not Enabled in XML Forms
        ADO Support for Windows
      Forms Migration: Working with Forms Created in Acrobat 6.0 or Earlier
        Detecting XML Forms and Earlier Form Types
    Filling in PDF Forms
      Completing Form Fields
        Completing Form Fields Automatically
        Spell-Checking Text in Forms
      Importing and Exporting Form Data
      Saving Form Data as XML or XML Data Package (XDP)
      Emailing Completed Forms
      Global Submit
    Making Forms Accessible
      Text-To-Speech
      Tagging Annotations
    Using JavaScript to Secure Forms
  Review, Markup, and Approval
    Introduction
      Chapter Goals
      Contents
    Online Collaboration Essentials
      Introduction
      Reviewing Documents with Additional Usage Rights
      Emailing PDF Documents
      Acrobat JavaScript-based Collaboration Driver
    Using Commenting Tools
      Adding Note Comments
      Making Text Edits
      Highlighting, Crossing Out, and Underlining Text
      Adding and Deleting Custom Stamps
      Adding Comments in a Text Box
      Adding Attachments
        Sound Attachments
        File Attachments
        Personalizing Attachments with a Description
        Opening and Saving Attachments
        console.println(cFile);
        );
        Saving Modified Files into the Primary Document
        Linking Between Files
        Deleting Attachments
      Spell-checking in Comments and Forms
        Setting Spelling Preferences
        Adding Words to a Dictionary
      Adding Commenting Preferences
      Changing Colors, Icons, and Other Comment Properties
      Adding Watermarks
        The Stamping User Interface
        Header and Footer Functionality
        Control of Font, Size, Placement, Rotation, and Opacity
      Approval
    Managing Comments
      Selecting, Moving, and Deleting Comments
      Using the Comments List
        Changing the Status of Comments
        Changing the Appearance of Comments
        Marking Comments with Checkmarks
        Sorting Comments
        Showing and Hiding Comments
        Finding Comments
      Exporting and Importing Comments
      Comparing Comments in Two PDF Documents
      Aggregating Comments for Use in Excel
      Extracting Comments in a Batch Process
    Approving Documents Using Stamps (Japanese Workflows)
      Setting up a Hanko Approval Workflow
        Adding Instructions
        Sending a Document by Email for Approval
      Participating in a Hanko Approval Workflow
        Applying a Hanko or Inkan Stamp
        Using Other Stamps and Comments
        Installing and Customizing Hanko Stamps
        Creating Custom Inkan Stamps
        Deleting Custom Stamps
  Working with Digital Media in PDF Documents
    Introduction
      Chapter Goals
      Contents
    Media Players: Control, Settings, Renditions, and Events
      Introduction
      Accessing a List of Active Players
      Specifying Playback Settings
    Monitors
    Integrating Media into Documents
      Adding Movie Clips
      Adding Sound Clips
      Adding and Editing Renditions
    Setting Multimedia Preferences
  Acrobat Templates
    Introduction
      Chapter Goals
      Contents
    The Role of Templates in PDF Form Architecture
      Introduction
    Spawning Templates
      Dynamic Form Field Generation
      Dynamic Page Generation
      Template Syntax and Usage
  Modifying the User Interface
    Introduction
      Chapter Goals
      Contents
    Using Adobe Dialog Manager (ADM) in Acrobat JavaScript
      Introduction
      ADM Object Hierarchy
      Access to ADM through JavaScript
    Adding Navigation to PDF Documents
      Thumbnails
        Creating Page Thumbnails
        Adding Page Actions with Page Thumbnails
      Bookmarks
        Creating Bookmarks
        Managing Bookmarks
        Creating a Bookmark Hierarchy
      Links
        Creating Links
        Defining the Appearance of a Link
        Editing Links
        Creating Links from URLs
        Linking to File Attachments
        Removing Web Links
        Using Destinations
      Using Actions for Special Effects
        Adding Actions
        Action Types
        Type of Triggers
      Highlighting Form Fields and Navigational Components
      Setting Up a Presentation
        Defining the Initial View in Full Screen View
        Defining an Initial View
        Adding Page Transitions
      Numbering Pages
      Creating Buttons
    Working with PDF Layers
      About PDF Layers
      Navigating with Layers
      Editing the Properties of PDF Layers
      Merging Layers
      Flattening PDF Layers
      Combining PDF Layered Documents
  Search and Index Essentials
    Introduction
      Chapter Goals
      Contents
    Searching for Text in PDF Documents
      Introduction
      Finding Words in an PDF Document
        Performing a Simple Search of a Document
        Using Advanced Search Options
      Searching Across Multiple PDF Documents
        Searching all PDF Files in a Specific Location
        Using Advanced Search Options for Multiple Document Searches
        Searching PDF Index Files
        Using Boolean Queries in Multiple Document Searches
    Indexing Multiple PDF Documents
      Creating, Updating, or Rebuilding Indexes
    Searching Metadata
      Using Acrobat JavaScript to Read and Search XMP Metadata
  Security
    Introduction
      Chapter Goals
      Contents
    Security Essentials
      Methods for Adding Security to PDF Documents
        Passwords and Restrictions
        Certifying Documents
        Encrypting Files Using Certificates
        Security Policies
        Secure Forms
    Digitally Signing PDF Documents
      Signing a PDF Document
        The Security Handler Object
        The SignatureInfo Object
        Applying the Signature
        Creating a New Signature Appearance
        Clearing a Digital Signature from a Signature Field
      Getting Signature Information from Another User
      Removing Signatures
      Certifying a Document
      Validating Signatures
      Using Approval Stamps
      Setting Digital Signature Preferences
    Adding Security to PDF Documents
      Adding Passwords and Setting Security Options
      Adding Usage Rights to a Document
      Encrypting PDF Files for a List of Recipients
      Encrypting PDF Files Using Security Policies
      Adding Security to Document Attachments
    Digital IDs and Certification Methods
      Digital IDs
        About Digital ID Providers
        Creating a Digital ID (Default Certificate Security)
        Using Digital IDs (Default Certificate Security)
        Managing Digital IDs (Windows Certificate Security)
      Managing Digital ID Certificates
        Sharing Digital ID Certificates
        Building a List of Trusted Identities
        Checking Information on Certificates
      Tokenized Acrobat JavaScript Security Model
  Rights-Enabled PDF Files
    Introduction
      Chapter Goals
      Contents
    Additional Usage Rights
    LiveCycle Reader Extensions
    Writing Acrobat JavaScript for Reader
    Enabling Collaboration
  Interacting with Databases
    Introduction
      Chapter Goals
      Contents
    Introduction to ADBC
    Establishing an ADBC Connection
    Executing SQL Statements
  SOAP and Web Services
    Introduction
      Chapter Goals
      Contents
    Using SOAP and Web Services
      Using a WSDL Proxy to Invoke a Web Service
      Synchronous and Asynchronous Information Exchange
        Establishing a Synchronous Connection
        Asynchronous Web Service Calls
      Using Document/Literal Encoding
      Exchanging File Attachments and Binary Data
      Converting Between String and ReadStream Information
      Accessing SOAP Version Information
      Accessing SOAP Header Information
      Authentication
      Error Handling
    DNS Service Discovery
    Managing XML-based Information
    Workflow Applications
  A Short Acrobat JavaScript FAQ
    Where can JavaScripts be found and how are they used?
    How should I name my Acrobat form fields?
    How do I use date objects?
      Converting from a Date to a String
      Converting from a string to a date
      Date arithmetic
    How can I make restricted Acrobat JavaScript methods available to users?
    How can I make my documents accessible?
      Document Metadata
      Short Description
      Setting Tab Order
      Reading Order
    How can I define global variables in JavaScript?
      Making Global Variables Persistent
    How can I hide an Acrobat form field based on the value of another?
    How can I query an Acrobat form field value in another open form?
    How can I intercept keystrokes one by one as they occur in Acrobat forms?
    How can I construct my own colors?
    How can I prompt the user for a response in a dialog?
    How can I fetch an URL from JavaScript?
    How can I determine if the mouse has entered/left a certain area on an Acrobat form?
    How can I disallow changes in scripts contained in my document?
    How can I hide scripts contained in my document?
  Index