13. Viewer Preferences

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 PreferenceEffect
PAGE_LAYOUT_SINGLE_PAGEDisplay one page at a time. (default)
PAGE_LAYOUT_ONE_COLUMNDisplay the pages in one column.
PAGE_LAYOUT_TWO_COLUMN_LEFTDisplay the pages in two columns, with odd numbered pages on the left.
PAGE_LAYOUT_TWO_COLUMN_RIGHTDisplay the pages in two columns, with odd numbered pages on the right.
PAGE_LAYOUT_TWO_PAGE_LEFTDisplay two pages at a time, with odd numbered pages on the left.
PAGE_LAYOUT_TWO_PAGE_RIGHTDisplay two pages at a time, with odd numbered pages on the right.
PAGE_MODE_USE_NONEShow no panel on startup.
PAGE_MODE_USE_OUTLINESShow document outline panel on startup.
PAGE_MODE_USE_THUMBSShow thumbnail images panel on startup.
PAGE_MODE_FULLSCREENSwitch to fullscreen mode on startup.
PAGE_MODE_USE_OCShow optional content group panel on startup.
PAGE_MODE_USE_ATTACHMENTSShow attachments panel on startup.
HIDE_TOOLBARHide the viewer application's tool bars when the document is active.
HIDE_MENUBARHide the viewer application's menu bar when the document is active.
HIDE_WINDOW_UIHide user interface elements in the document's window.
FIT_WINDOWResize the document's window to fit the size of the first displayed page
CENTER_WINDOWPosition the document's window in the center of the screen.
DISPLAY_DOC_TITLEDisplay the document's title in the top bar.
NON_FULLSCREEN_PAGE_MODE_USE_NONEShow document outline panel on exiting full-screen mode. Has to be combined with PageModeFullScreen.
NON_FULLSCREEN_PAGE_MODE_USE_OUTLINESShow thumbnail images panel on exiting full-screen mode. Has to be combined with PageModeFullScreen.
NON_FULLSCREEN_PAGE_MODE_USE_THUMBSShow optional content group panel on exiting full-screen mode. Has to be combined with PageModeFullScreen.
NON_FULLSCREEN_PAGE_MODE_USE_OCShow attachments panel on exiting full-screen mode. Has to be combined with PageModeFullScreen.
DIRECTION_L2RPosition pages in ascending order from left to right.
DIRECTION_R2LPosition pages in ascending order from right to left.
PRINTSCALING_NONEPrint dialog default setting: disabled scaling
PRINTSCALING_APPDEFAULTPrint dialog default setting: set scaling to application default value
DUPLEX_SIMPLEXPrint dialog default setting: simplex
DUPLEX_FLIP_SHORT_EDGEPrint dialog default setting: duplex (short edge)
DUPLEX_FLIP_LONG_EDGEPrint dialog default setting: duplex (long edge)
PICKTRAYBYPDFSIZE_FALSEPrint dialog default setting: do not pick tray by PDF size
PICKTRAYBYPDFSIZE_TRUEPrint dialog default setting: pick tray by PDF size