Adobe acrobat forms javascript object specification User Manual

Page of 64
Acrobat Forms - JavaScript Object Specification
20
Doc Object
The JavaScript Doc object provides the interfaces between a PDF document open in the viewer
and the JavaScript interpreter. It provides methods and properties of the PDF document.
Doc Access from JavaScript
Accessing the Doc object from JavaScript can be done either through the
which
usually points to the Doc object of the underlying document. The
event property points
to the field that initiated the event for all mouse, calculate, validate, and format events. For all
other events, it directly points to the Doc object. The examples below illustrates the use of the
Event object to access the Doc object of the underlying document.
// In Mouse, calculate, validate, format events
var doc = event.target.doc;
// In all other events
var doc = event.target;
Doc Object Properties
author
Type: String
Access: R/W
This property defines the author of the document.
this.author = "Robert Frost";
calculate
Type: Boolean
Access: R/W
If this property is set to true, it will allow calculations to be performed for this document. If
set to false, this property prevents all calculations from happening for this document. Its
default value is true. This property supersedes the application level
property whose
use is now discouraged.
creator
Type: String
Access: R
This property defines the creator of the document (e.g. “Adobe FrameMaker”, “Adobe
PageMaker
”, etc.).
4.0