class: com.nbx.pdfviewer.Option
Control Sample: com.nbx.pdfviewer.PDFViewer | Module: com/nbx/pdfviewer/Option | Application Component: NBX-UI5-PDFViewer |
Documentation: Nubexx PDF Viewer | Visibility: public | Minimum Ui5-Version required: 1.71 |
Extends: sap.m.PDFViewer |
Overview
Contains a single key/value pair of custom configuration data for the embedded pdf.js viewer at initialization time.
Constructor
Constructor for a new Option element.
new com.nbx.pdfviewer.Option(sId?, mSettings?)
Param | Type | Default value | Description |
---|---|---|---|
sId? | string | Id for the new control, generated automatically if no id is given. | |
mSettings? | object | Initial settings for the new control. |
Properties
Name | Type | Default Value | Description |
---|---|---|---|
key | string | The key of the configuration option. See below | |
value | string | The value of the configuration option. See below |
Configuration options
Options by Nubexx build of pdf.js
Name | Type | Default | Description |
---|---|---|---|
allowContextMenu | Boolean | false | Set to true if context menu over the viewer should be allowed. |
allowOpenFromUi | Boolean | false | Open icon is shown in second toolbar & open file by STRG+ O and drag & drop is allowed. |
allowOverrideProtectedApiSettings | Boolean | false | If true, protected API-Settings be can set more than once. Normally, properties such as showDownloadButton, showPrintButton or watermark aggregations must be assigned to the PDF control only once. If allowOverrideProtectedApiSettings is set to true, these settings can be overwritten after the initial setting of these properties are applied.info This property should be set to false. This prevents a user from overwriting these properties in the browser console. |
allowPresentationMode | Boolean | false | If true, then viewers presentation (full screen) mode is available. info This did not work in all cases, e.g. when the viewer was located in a frame element or in a WebView on iOS. |
askForFileNameOnDownload | Boolean | false | If enabled, a file dialog box is asking for filename on save / download file. info This feature is not Baseline because it does not work in some browsers and is only available in secure contexts (HTTPS), in some or all supporting browsers. In unsupported browsers, the default behavior is used ( |
showToolbar | Boolean | true | Defines the initial visibility of the toolbar when the viewer is started. |
toolbarColorSigned | Object | { light:"rgb(143,223,239)", dark:"rgb(0,75,115)" } | Set toolbar background color if document is signed |
toolbarShowSignedFlag | Boolean | true | If set to true: Shows a button in the toolbar if the document is digitally signed. |
versionPrefix | String | Prefix for version info in file preferences dialog |
Options by pdf.js
Default values in parentheses are changed in Nubexx build.
Name | Type | Default | Description |
---|---|---|---|
annotationEditorMode | Number | 0 (-1) | Controls the annotation editor mode.
|
annotationMode | Number | 1 | Controls which annotations are rendered.
|
cursorToolOnLoad | Number | 0 | The cursor tool that will be enabled on load.
|
defaultZoomValue | String | empty (page-width) | Default zoom level of the viewer.
|
disableAutoFetch | Boolean | false | If activated, pages are not loaded in advance. Only pages that are currently required are loaded. This may reduce data consumption for large PDFs or slow connections. If the user scrolls quickly through the document, delays may occur. info The server which delivered the pdf files must support range requests. Most common web servers supports this. |
disableHistory | Boolean | false | Disable browsing history. The browsing history is only enabled when the viewer is standalone, i.e. not when it is embedded in a web page. See: historyUpdateUrl |
disablePageLabels | Boolean | false (true) | If activated, user-defined page labels are not used in a PDF document. Some PDFs define custom page labels, such as: Roman numerals (I, II, III, ...) |
disablePreferences | Boolean | false (true) | Disable console warning on manual override AppOptions |
disableRange | Boolean | false | Disable range requests (not recommended). If disabled, the PDF is displayed only after the file is fully loaded. |
disableStream | Boolean | false | Disable streaming for requests (not recommended). |
enableAutoLinking | Boolean | true (false) | Enable creation of hyperlinks from text that look like URLs. |
enableHighlightFloatingButton | Boolean | false | Floating Highlight-Button direct on text select |
enablePermissions | Boolean | false | (check) Enables PDF document permissions, when they exist |
enablePrintAutoRotate | Boolean | true | When enabled, landscape pages are rotated when printed. |
enableScripting | Boolean | false | Whether to allow execution of active content (JavaScript) by PDF files. |
enableSignatureEditor | Boolean | true | If enabled, the signature annotation editor is active |
enableUpdatedAddImage | Boolean | false | Enabled new "add image" dialog |
externalLinkRel | String | noopener noreferrer nofollow | Set rel attribute for external links.
|
externalLinkTarget | Number | 0 (2) | Controls how external links will be opened. |
forcePageColors | Boolean | false | If enabled, the pdf rendering will use the high contrast mode colors |
highlightEditorColors | String | yellow=#FFFF98, green=#53FFBC, blue=#80EBFF, pink=#FFCBE6, red=#FF4F5F | Available Colors in highlight editor |
historyUpdateUrl | Boolean | false | Enable historyUpdateUrl. If activated, the URL hash is updated e.g. in the page navigation like #page=2 |
ignoreDestinationZoom | Boolean | false | If enabled, the current zoom level is used or specified via the defaultZoomValue option instead of being taken from the PDF document. |
imageResourcesPath | String | ./images/ | Path for image resources, mainly for icons. Include trailing slash |
localeProperties | Object | { lang: navigator.language || "en-US" } | Localization to use. |
pageColorsBackground | String | Canvas | The Background color of the page as CSS color string. To improve readability in high-contrast mode. |
pageColorsForeground | String | Canvas | The Foreground color of the page as CSS color string. To improve readability in high-contrast mode. |
printResolution | String | 150 | Specify print resolution in dpi. |
scrollModeOnLoad | Number | -1 (0) | Controls the viewers scroll mode upon load.
|
sidebarViewOnLoad | Number | -1 (0) | Controls the state of the sidebar upon load.
|
spreadModeOnLoad | Number | -1 (0) | Whether the viewer should join pages into spreads upon load.
|
supportsCaretBrowsingMode | Boolean | false | Enable support for caret browsing |
supportsIntegratedFind | Boolean | false | Set to true to enable browser search and disable PDF.js search |
supportsMouseWheelZoomCtrlKey | Boolean | true | If enabled, zoom can controlled with mouse wheel + ctrl key |
supportsMouseWheelZoomMetaKey | Boolean | true | If enabled, zoom can controlled with mouse wheel + meta key |
supportsPinchToZoom | Boolean | true | Enable zooming on pinch gesture |
textLayerMode | Number | 1 | Controls if the text layer is enabled, and the selection mode that is used.
tip Set this to 0 to prevent copy text from pdf content. |
toolbarDensity | Number | 0 | Set the toolbar density. value.
tip Set this to 2 depending on device type such phone for better useability. |
viewOnLoad | Number | 0 (1) | The position in the document upon load.
|