ViewerPreferences: { centerWindow?: boolean; displayDocTitle?: boolean; fitWindow?: boolean; hideMenubar?: boolean; hideToolbar?: boolean; hideWindowUI?: boolean; nonFullScreenPageMode?: PageMode; openAction?: OpenAction; pageLayout?: PageLayout; pageMode?: PageMode }

A viewer preferences specifying the way the document shall be displayed on the screen.

Type declaration

  • Optional centerWindow?: boolean

    A flag specifying whether to position the document’s window in the centre of the screen.

  • Optional displayDocTitle?: boolean

    A flag specifying whether the window’s title bar should display the document title taken from the dc:title element of the XMP metadata stream (see 14.3.2, "Metadata streams"). If false, the title bar should instead display the name of the PDF file containing the document.

  • Optional fitWindow?: boolean

    A flag specifying whether to resize the document’s window to fit the size of the first displayed page.

  • Optional hideMenubar?: boolean

    A flag specifying whether to hide the interactive PDF processor’s menu bar when the document is active. Default value: false.

  • Optional hideToolbar?: boolean

    A flag specifying whether to hide the interactive PDF processor’s tool bars when the document is active. Default value: false.

  • Optional hideWindowUI?: boolean

    A flag specifying whether to hide user interface elements in the document’s window (such as scroll bars and navigation controls), leaving only the document’s contents displayed.

  • Optional nonFullScreenPageMode?: PageMode

    The document’s page mode, specifying how to display the document on exiting full-screen mode

  • Optional openAction?: OpenAction

    (PDF 1.1) A value specifying a destination that shall be displayed or an action that shall be performed when the document is opened. The value shall be either an array defining a destination (see 12.3.2, "Destinations") or an action dictionary representing an action (12.6.2, "Action dictionaries"). If this entry is absent, the document shall be opened to the top of the first page at the default magnification factor.

  • Optional pageLayout?: PageLayout

    A name object specifying the page layout shall be used when the document is opened. The following pageLayout values specified in the PDF document correspond to the pageDisplay values in the viewer:

    • TwoColumnLeft: This sets pageDisplay to TwoPageScrolling.
    • TwoColumnRight: This sets pageDisplay to TwoPageScrolling.
    • TwoPageLeft: This sets pageDisplay to TwoPage.
    • TwoPageRight: This sets pageDisplay to TwoPage.
    • OneColumn: This sets pageDisplay to SinglePageScrolling.
    • SinglePage: This sets pageDisplay to SinglePage.
  • Optional pageMode?: PageMode

    A name object specifying how the document shall be displayed when opened:

    • UseNone Neither document outline nor thumbnail images visible
    • UseOutlines Document outline visible
    • UseThumbs Thumbnail images visible
    • FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible
    • UseOC (PDF 1.5) Optional content group panel visible
    • UseAttachments (PDF 1.6) Attachments panel visible Default value: UseNone.