You can configure the initial presentation of the document in the viewer by setting viewer preferences. Setting viewer preferences will activate / deactivate certain options of the viewer, for example it allows to hide the viewer's toolbar when the document is opened.
Note that these preferences are not enforced, i.e. if you decide to set the HIDE_TOOLBAR preference, the user can still display the toolbar again when viewing this PDF if he decides to do so. Setting this preference only affects the default state of the toolbar when the document is opened, but does not enforce this state.
Some viewer preferences also influence the default settings of the print dialog of the viewer.
You can set viewer preferences by using the method "setViewerPreferences". Multiple preferences can be combined using the "OR" operator, e.g.:
pdfReactor.setViewerPreferences(
PDFreactor.VIEWER_PREFERENCES_PAGE_LAYOUT_SINGLE_PAGE |
PDFreactor.VIEWER_PREFERENCES_DISPLAY_DOC_TITLE);PDFreactor supports the following viewer preferences:
Table IV.3. List of Viewer Preferences
| Viewer Preference | Effect |
|---|---|
| PAGE_LAYOUT_SINGLE_PAGE | Display one page at a time. (default) |
| PAGE_LAYOUT_ONE_COLUMN | Display the pages in one column. |
| PAGE_LAYOUT_TWO_COLUMN_LEFT | Display the pages in two columns, with odd numbered pages on the left. |
| PAGE_LAYOUT_TWO_COLUMN_RIGHT | Display the pages in two columns, with odd numbered pages on the right. |
| PAGE_LAYOUT_TWO_PAGE_LEFT | Display two pages at a time, with odd numbered pages on the left. |
| PAGE_LAYOUT_TWO_PAGE_RIGHT | Display two pages at a time, with odd numbered pages on the right. |
| PAGE_MODE_USE_NONE | Show no panel on startup. |
| PAGE_MODE_USE_OUTLINES | Show document outline panel on startup. |
| PAGE_MODE_USE_THUMBS | Show thumbnail images panel on startup. |
| PAGE_MODE_FULLSCREEN | Switch to fullscreen mode on startup. |
| PAGE_MODE_USE_OC | Show optional content group panel on startup. |
| PAGE_MODE_USE_ATTACHMENTS | Show attachments panel on startup. |
| HIDE_TOOLBAR | Hide the viewer application's tool bars when the document is active. |
| HIDE_MENUBAR | Hide the viewer application's menu bar when the document is active. |
| HIDE_WINDOW_UI | Hide user interface elements in the document's window. |
| FIT_WINDOW | Resize the document's window to fit the size of the first displayed page |
| CENTER_WINDOW | Position the document's window in the center of the screen. |
| DISPLAY_DOC_TITLE | Display the document's title in the top bar. |
| NON_FULLSCREEN_PAGE_MODE_USE_NONE | Show document outline panel on exiting full-screen mode. Has to be combined with PageModeFullScreen. |
| NON_FULLSCREEN_PAGE_MODE_USE_OUTLINES | Show thumbnail images panel on exiting full-screen mode. Has to be combined with PageModeFullScreen. |
| NON_FULLSCREEN_PAGE_MODE_USE_THUMBS | Show optional content group panel on exiting full-screen mode. Has to be combined with PageModeFullScreen. |
| NON_FULLSCREEN_PAGE_MODE_USE_OC | Show attachments panel on exiting full-screen mode. Has to be combined with PageModeFullScreen. |
| DIRECTION_L2R | Position pages in ascending order from left to right. |
| DIRECTION_R2L | Position pages in ascending order from right to left. |
| PRINTSCALING_NONE | Print dialog default setting: disabled scaling |
| PRINTSCALING_APPDEFAULT | Print dialog default setting: set scaling to application default value |
| DUPLEX_SIMPLEX | Print dialog default setting: simplex |
| DUPLEX_FLIP_SHORT_EDGE | Print dialog default setting: duplex (short edge) |
| DUPLEX_FLIP_LONG_EDGE | Print dialog default setting: duplex (long edge) |
| PICKTRAYBYPDFSIZE_FALSE | Print dialog default setting: do not pick tray by PDF size |
| PICKTRAYBYPDFSIZE_TRUE | Print dialog default setting: pick tray by PDF size |