class: com.nbx.pdfviewer.PDFViewer
com.nbx.pdfviewer.PDFViewer
extends the SAP UI5 PDFViewer.
It provides all properties, events etc. from sap.m.PDFViewer.
Control Sample: com.nbx.pdfviewer.PDFViewer | Module: com/nbx/pdfviewer/PDFViewer | Application Component: NBX-UI5-PDFViewer |
Documentation: Nubexx PDF Viewer | Visibility: public | Minimum Ui5-Version required: 1.71 |
Extends: sap.m.PDFViewer |
Overview
This control allows you to display PDF documents on all device platforms (desktop / laptop, tablet and mobile phone) within your UI5 app. It can be embedded in your user interface layout, or you can set it to open in a popup dialog.
Constructor
Definition of Nubexx PDF Viewer control
Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.
new com.nbx.pdfviewer.PDFViewer(sId?, mSettings?)
Parameter | 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
All properties from sap.m.PDFViewer.
Changed properties
Name | Type | Default Value | Description |
---|---|---|---|
displayType | sap.m.PDFViewerDisplayType | Embedded | This setting is ignored because the viewer is embedded on all device types. |
showDownloadButton | boolean | true | Show or hide the download button in the controls toolbar and allow or disallow downloading the PDF file. 1, 2 |
showPrintButton | boolean | true | Show or hide the print button in the controls toolbar and allow or disallow printing the PDF file. 3 |
isTrustedSource | boolean | false | This setting is ignored. |
Additional properties
Name | Type | Default Value | Description |
---|---|---|---|
decryptionParams | string | Decryption params. | |
downloadFileName | string | Set alternative file name for download. | |
showToolbar | com.nbx.pdfviewer.PDFViewerShowToolbar | Auto | Controls the visibility of the PDF viewer toolbar. 4 |
showWatermark | boolean | false | Shows or hides watermark defined in watermark aggregation. 5 |
decryptionParams 6
The Nubexx PDF Viewer can decrypt AES encrypted PDF files. The AES-Counter mode must be used for the encryption. This is useful to prevent bypass access to the PDF file, e.g. via the browser console. Especially if the current user is not allowed to save/download the PDF file or the PDF viewer generates a watermark on the PDF file to be displayed.
[!NOTE]be The AES decryption feature is currently a developer preview.
Format: <IV>:<AES-Key>
- IV: 16 bytes initialization vector as base64 encoded string followed by a colon character
- AES-Key: 16 or 32 bytes AES key as base64 encoded string
Alternating format: <AES-Key>
- Alternative to the format
<IV>:<AES-Key>
in the decryptionParams property the string can contain a 16 or 32 bytes AES key as base64 encoded string. In this case, the delivering server must encode the IV in the first 16 bytes of the PDF stream.
[!NOTE] The IV must be unique for each PDF file delivered. Ideally, a 16-byte random value should be used here.
Aggregations
Name | Cardinality | Type | Description |
---|---|---|---|
pdfViewerOptions | 0..n | com.nbx.pdfviewer.Option | Options to initialize the build in pdf.js viewer |
watermarkText | 0..n | com.nbx.pdfviewer.Watermark.Text | Text watermark objects to render over the PDF layer 5 |
watermarkImage | 0..n | com.nbx.pdfviewer.Watermark.Image | Image watermark objects to render over the PDF layer 5 |
Events
Name | Description |
---|---|
error | This event is fired when there is an error loading the PDF file. |
loaded | This event is fired when a PDF file is loaded. |
initialized | This event is fired when the viewer is fully loaded and initialized, but before the loaded event is fired. |
error
This event is fired when there is an error loading the PDF file.
Parameter | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
target | any | The iframe element. |
details | object | |
message | string | The message |
reason | string | The reason |
source | object | The PDF.js object |
loaded
Parameter | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
target | object | The PDF.js object |
initialized
Parameter | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
target | object | The PDF.js object |
Footnotes
-
This behavior has been changed in the Nubexx PDF Viewer. In the viewer area there is now only one download button whose visibility is controlled by
showPrintButton
. The redundant download icon in the control header or in the footer of the popup is not displayed anymore. ↩ -
The download button can not be disabled in the trial version of the PDF Viewer. ↩
-
The print button can not be disabled in the trial version of the PDF Viewer. ↩
-
The toolbar is always set to
Auto
in the trial version of the PDF Viewer. ↩ -
Watermarks are not supported in the trial version of the PDF Viewer. ↩ ↩2 ↩3
-
The decryption function is not supported in the trial trial version of the PDF Viewer. ↩