PDF Viewer

../../../_images/osp-pdfviewer-example.png

The PDFViewer widget allows visualizing a pre-existing PDF. The source of the PDF can be fed by multiple means:

  • A Base64 text represent the content of the PDF

  • An external URL, might need the usage of a proxy

  • A PDF present in the configuration and defined as a web module resource. Reference the PDF by using the destination path specified in the resources.

Capabilities

Capability

Support

Comment

Load a PDF from a Base64 text

Supported feature

The widget can load a PDF from a Base64 representation of the PDF content.

Load a PDF from an URL

Supported feature

Warning, loading from an URL might cause you trouble with CORS issues. Take a look at the OnSphere Proxy to help you access external URLs.

Load a PDF from a PDF file present in the configuration

Supported feature

You can load a PDF file from the configuration if it was declared as a resources of the web module.

Change the PDF displayed from an alarm table

Supported feature

Using a menu on an alarm table can set the PDF displayed by the widget. See menus and toolbar

Change the PDF displayed from a collection table

Supported feature

Using a menu on a collection table can set the PDF displayed by the widget. See menus and toolbar

Handle and display multiples PDF

Not supported feature

The widget can only display one PDF at a time.

Set PDF from an URL parameter

Not supported feature

URL parameter are not handled by this widget.

List of configuration files

Filename

Short description

Format

Link to documentation

dashboard.view#PdfViewerWidget

Defines the PdfViewerWidget widget global settings

json

Link

List of examples

Short description

Link to documentation

Load a PDF from the configuration into a widget

Link

Load a PDF from a menu on an table widget

Link

Controls

A control panel allows you to interact with the viewer in different ways:

  • Orientation: you can change the way you display the PDF pages (all in one or one by one)

  • Page number: navigate to the previous/next page or input a specific page

  • Zoom: zoom in and out

  • Fullscreen: view the pdf in fullscreen mode

Open in another window

Using the button at the left of the control panel, you can open the content of the widget into a separated window. While the content is display in the other window, the widget will display an informative text and a button allowing to revert this action.

Widget context

Operations

PDFViewer support following operation:

  • pdf(pdf: string): change the source of the currently loaded pdf