Skip to main content
Version: Version 4

Interface reference

Learn about available options for various configurable parameters in the PDF Viewer SDK reference documentation.

Enumerations​

PdfPageLayoutMode​

NameDescription
SINGLE_PAGEDisplay a sinlge page at a time.
ONE_COLUMNDisplay a column of pages.
TWO_COLUMN_LEFTDisplay pages as two columns next to each other. The first page is on the left.
TWO_COLUMN_RIGHTDisplay pages as two columns next to each other. The first page is on the right.
TWO_PAGE_LEFTDisplay two pages next to each other. The first page is on the left.
TWO_PAGE_RIGHTDisplay two pages next to each other. The first page is on the right.

StampAnnotationColor​

NameDescription
GREENThe stamp annotation has green color.
REDThe stamp annotation has red color.
BLUEThe stamp annotation has blue color

WebViewerOptions​

The PDF Viewer SDK lets you configure many options in its index.html.

viewer​

viewer.general​

  • viewer.general.user Set the name of the user.
    • Type: string
    • Default value: '' (No user set)
  • viewer.general.language Set language of the tooltips as a two letter language code. See also Custom translations.
    • Type: string
    • Allowed values: 'en', 'de', 'fr', 'it' and custom languages.
    • Default value 'en'
  • viewer.general.promptOnUnsavedChange If an opened document has unsaved changes and a user presses the open or close buttons the PDF Viewer SDK displays an unsaved changes dialog box. Surpress the dialog box by setting the boolean value of viewer.general.promptOnUnsavedChange to false.
    • Type: boolean
    • Default value: true
  • viewer.general.pageShadow Define the page shadow. The color is a CSS color string. The unit of the other values are in screen pixel.
    • Type: [CanvasShadowStyles](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowBlur)
    • Default: not set
    • Example:
      CanvasShadowStyles {
      shadowBlur: number;
      shadowColor: string;
      shadowOffsetX: number;
      shadowOffsetY: number;
      }
  • viewer.general.pageShadow Define the page shadow for the current page. The color is a CSS color string. The unit of the other values are in screen pixel.
    • Type: [CanvasShadowStyles](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowBlur)
    • Default: not set
    • Example:
      CanvasShadowStyles {
      shadowBlur: number;
      shadowColor: string;
      shadowOffsetX: number;
      shadowOffsetY: number;
      }
  • viewer.general.tooltips Tooltips can be turned on with 'title' and turned off with 'none'. If you want use your own CSS stylesheet to configure the tooltips, set 'css'.
    • Type: string
    • Allowed values: 'none', 'title', 'css'
    • Default value: 'title'
  • viewer.general.hidePasswordFormCancelButton Hide the Cancel button in the password dialog for password-protected PDFs.
    • Type: boolean
    • Default value: false

viewer.sidebar​

  • viewer.sidebar.thumbnailNavigation Define if thumbnails are visible in the Information pane.
    • Type: boolean
    • Default value: true
  • viewer.sidebar.outlineNavigation Define if outlines are visible in the Information pane.
    • Type: boolean
    • Default value: true
  • viewer.sidebar.annotationNavigation Define whether annotations are visible in the Information pane.
    • Type: boolean|object
    • Default value: true
  • viewer.sidebar.annotationNavigation.textMarkup.preview Define if the preview for text markup annotations is enabled in the Information pane.
    • Type: string
    • Allowed values: 'none', 'short'
    • Default value: 'none'

viewer.permissions​

  • viewer.permissions.allowFileDrop Specify if the files can be opened with drag and drop.
    • Type: boolean
    • Default value: true
  • viewer.permissions.allowSaveFile Specify if the files can be saved.
    • Type: boolean
    • Default value: true
  • viewer.permissions.allowCloseFile Specify if the files can be closed.
    • Type: boolean
    • Default value: false
  • viewer.permissions.allowOpenFile Specify if the files can be opened.
    • Type: boolean
    • Default value: true
  • viewer.permissions.allowPrinting Specify if the files can be printed.
    • Type: boolean
    • Default value: false
  • viewer.permissions.allowExternalLinks Specifies whether external links in the document are interactive.
    • Type: boolean
    • Default value: true
  • viewer.permissions.enableSearch Set if a file can be searched.
    • Type: boolean
    • Default value: true

viewer.customButtons​

For initial information and examples, review Custom buttons documentation.

  • viewer.customButtons.documentbar Add buttons to the Document bar.
    • Type: CustomButton[]
    • Default value: empty array
  • viewer.customButtons.informationbar Add buttons to the Information pane.
    • Type: CustomButton[]
    • Default value: empty array
  • viewer.permissions.allowCloseFile Add buttons to the Annotation bar.
    • Type: CustomButton[]
    • Default value: empty array

annotation​

  • annotation.defaultStampWidth Set a width of the Stamp annotation when it is created. The units used are in PDF points. Size of one point is 1/72 inch, or one inch is 72 points.
    • Type: number
    • Default value: 120
  • annotation.hideAnnotationSubject Annotation subject is not visible.
    • Type: boolean
    • Default value: false
  • annotation.hideOnDelete If set as true and a user deletes an annotation, the annotation is flagged as hidden and not deleted. If set as false the annotation is deleted if a user deletes an annotation.
    • Type: boolean
    • Default value: false
  • annotation.onlyAuthorCanEdit Changes to annotations can only be applied when the current user is the author of the annotation.
    • Type: boolean
    • Default value: false

shortcuts​

For general information and examples, review Keyboard shortcuts.

  • shortcuts.zoomIn Zoom in a document.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: '+' }
  • shortcuts.zoomOut Zoom out in a document.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: '-' }
  • shortcuts.nextPage Next page.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'PageDown' }
  • shortcuts.previousPage Previous page.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'PageUp' }
  • shortcuts.firstPage Go to the first page.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'Home' }
  • shortcuts.lastPage Go to the last page.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'End' }
  • shortcuts.scrollUp Scroll up.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'ArrowUp' }
  • shortcuts.scrollDown Scroll down.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'ArrowDown' }
  • shortcuts.scrollLeft Scroll left.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'ArrowLeft' }
  • shortcuts.scrollRight Scroll right.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'ArrowRight' }
  • shortcuts.releaseSelection Release selection.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'Escape' }
  • shortcuts.copy Copy selected text.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'c', ctrlKey: 'true' }
  • shortcuts.print Open print dialog.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'p', ctrlKey: 'true' }
  • shortcuts.cancelPrint Cancel printing.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'Escape' }
  • shortcuts.resetZoom Zoom to 100%.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'z', altKey: true }
  • shortcuts.fitToPage Fit to page.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'p', altKey: true }
  • shortcuts.fitToWidth Fit to width.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'w', altKey: true }
  • shortcuts.rotateView Rotate view.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'r', altKey: true }
  • shortcuts.save Save or save callback.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 's', ctrlKey: true }
  • shortcuts.search Search.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'f', ctrlKey: true }
  • shortcuts.searchNext Next search match.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'F3' }
  • shortcuts.searchPrevious Previous search match.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'F3', shiftKey: true }
  • shortcuts.closeSearch Close search.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'Escape' }
  • shortcuts.toggleSidePane Toggle side pane.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 's', altKey: true }
  • shortcuts.showAnnotations Display annotation pane.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'a', altKey: true }
  • shortcuts.showOutline Display outline pane.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 'o', altKey: true }
  • shortcuts.showThumbnails Display thumbnails pane.
    • Type: KeyboardShortcutBinding Review Keyboard shortcuts for a specific example.
    • Default parameter and value: { key: 't', altKey: true }