Modifying the User Interface
Adding Navigation to PDF Documents
10
You can also set the zoom type by assigning one of the settings, shown below in
to the
doc
object’s
zoomtype
property:
T
ABLE
10.13
ZoomType Settings
Zoom Type
Property Value
NoVary
FitPage
FitWidth
FitHeight
FitVisibleWidth
Preferred
ReflowWidth
zoomtype.none
zoomtype.fitP
zoomtype.fitW
zoomtype.fitH
zoomtype.fitV
zoomtype.pref
zoomtype.refW
The following example sets the zoom type of the document to fit the width:
this.zoomType = zoomtype.fitW;
To specify the page to which the document initially opens, set the
doc
object’s
pageNum
property. If the following code is included in the script used in the document
Open
event,
the document automatically opens to page 30:
this.pageNum = 30;
Finally, you may choose whether menu items and toolbar buttons will be visible by
invoking the following methods of the
app
object:
●
●
hideMenuItem
: removes a specific menu item
hideToolbarButton
: removes a specific toolbar button
For example, if the following code is placed in a folder-level script, the "Hand" icon is
removed when Acrobat or Adobe Reader is started:
app.hideToolbarButton("Hand");
Acrobat JavaScript Scripting Guide
183