PDFViewer

MacroModule
author Marcus Barann
package FMEstable/ReleaseMeVis
definition PDFViewer.def
keywords pdf

Purpose

Displays PDFs through an HTML page using mozilla’S PDF.js in a QWebEngineView.

Usage

The idea of this macro is to embed a PDF viewer in another panel. Add this macro to your macros internal network and use the MDL Panel control for the PDF viewer:

Panel {
  module = PDFViewer
  panel = pdfViewport
}

Limitations

Printing

  1. Printing is possible, but the print result does not have best quality. The reason is that the PDF is not directly printed, but the PDFjs library renders a PNG image that is printed. For example, this makes the text font look less sharp.
  2. Another issue is that the print dialog does not use the page size (e.g. US Letter, DIN A4) and layout (Landscape, Portrait) settings of the PDF document, so a user has to ensure that the correct settings are used.
  3. If the print dialog is opened very quickly after a PDF is loaded, then it may not respond and needs to be closed before another attempt can be made (observed on Ubuntu 18.04).

Download Button

The function of this button is currently not implemented.

Windows

Default Panel

../../../Modules/Macros/PDFViewer/mhelp/Images/Screenshots/PDFViewer._default.png

Parameter Fields

Hidden Fields

toolBarVisible

name: toolBarVisible, type: Bool, default: TRUE

Controls if the toolbar inside the PDF viewer is visible or not.

pdfViewerURL

name: pdfViewerURL, type: String

The URL to the HTML page that renders the PDF. If empty, `$MLAB_FMEwork_Thirdparty/Sources/web/PDFjs/web/viewer.html` is used as default. This has typically not to be changed, but can be used to customize the HTML viewer.

pdfFilename

name: pdfFilename, type: String

The name of the PDF file to load.

isPDFLoaded

name: isPDFLoaded, type: Bool, persistent: no

isPDFLoading

name: isPDFLoading, type: Bool, persistent: no

hasPDFLoadingError

name: hasPDFLoadingError, type: Bool, persistent: no

pdfLoadingError

name: pdfLoadingError, type: String, persistent: no

isViewerReady

name: isViewerReady, type: Bool, persistent: no

useOwnJSLoggingCategoryFilter

name: useOwnJSLoggingCategoryFilter, type: Bool, default: TRUE

printerAvailable

name: printerAvailable, type: Bool, persistent: no

printingCancelled

name: printingCancelled, type: Bool, persistent: no

preparePrinter

name: preparePrinter, type: Trigger

pageHeightInInches

name: pageHeightInInches, type: Float, persistent: no

pageWidthInInches

name: pageWidthInInches, type: Float, persistent: no

pageLayout

name: pageLayout, type: Enum, default: Portrait

Values:

Title Name
Portrait Portrait
Landscape Landscape