A viewer object represents the viewer preferences stored in the current document and provides the following properties.
navigation (integer)
Returns an integer indicating which navigation panel is displayed when the document is opened.
Tip: You can use the global variables shown in brackets instead of the numeric values.
Possible values:
-
Page only:
0(navigation.none) -
Bookmarks panel and page:
1(navigation.bookmarks) -
Pages Panel and Page:
2(navigation.pages) -
Layers Panel and Page:
3(navigation.attachments) -
Attachments Panel and Page:
4(navigation.layers)
Example:
document.viewer.navigation // returns an integer indicating which navigation panel is displayed
pageLayout (integer)
Returns an integer indicating how pages are displayed in the PDF viewer.
Tip: You can use the global variables shown in brackets instead of the numeric values.
Possible values:
-
Single Page:
0(pageLayout.single) -
Single Page Continuous:
1(pageLayout.singleColumn) -
Two-Up (Facing):
2(pageLayout.two) -
Two-Up Continuous (Facing):
3(pageLayout.twoColumn) -
Two-Up (Cover Page):
4(pageLayout.twoCover) -
Two-Up Continuous (Cover Page):
5(pageLayout.twoColumnCover)
Example:
document.viewer.pageLayout // returns an integer indicating how pages are displayed
windowTitle (integer)
Returns an integer indicating what is shown in the PDF viewer’s title bar.
Tip: You can use the global variables shown in brackets instead of the numeric values.
Possible values:
-
Document Title:
0(windowTitle.title) -
File Name:
1(windowTitle.file)
Example:
document.viewer.windowTitle // returns an integer indicating what is shown in the title bar
fullscreen (boolean)
Returns whether the document is configured to open in fullscreen mode (hiding menu bar, toolbar, and window controls).
Example:
document.viewer.fullscreen // returns true if the document is configured to open in fullscreen mode
centerWindow (boolean)
Returns whether the document window is centered on the screen when opened.
Example:
document.viewer.centerWindow // returns true if the document window is centered on the screen
hideMenu (boolean)
Returns whether the PDF viewer’s menu bar is hidden when the document is opened.
Example:
document.viewer.hideMenu // returns true if the menu bar is hidden
hideToolbar (boolean)
Returns whether the PDF viewer’s toolbar is hidden when the document is opened.
Example:
document.viewer.hideToolbar // returns true if the toolbar is hidden
hideControls (boolean)
Returns whether standard window controls (such as minimize, maximize, and close buttons) are hidden.
Example:
document.viewer.hideControls // returns true if standard window controls are hidden
fitToWindow (boolean)
Returns whether the document is configured to scale to fit the viewer window when opened.
Example:
document.viewer.fitToWindow // returns true if the document is scaled to fit the viewer window