Top  | Previous | Next

header_logo PDF Viewer

Icon in toolbar: pdfviewericon

 

pdfviewer

The PDF Viewer viewing a maintenance manual.

Description

The PDF Viewer component displays a PDF that exists as a file in some accessable filesystem, or as a URL. Note that this component is simply for viewing existing PDFs - for creating dynamic reports, use the Report Viewer component.

This component is typically used in conjuction with the File Explorer component, in order to create a PDF viewing window. See the File Explorer's documentation for instructions on how to put these two components together.

Properties

Filename

filename

STRING

link

The path or URL to the PDF file to display. Examples: "C:\PDFFiles\example.pdf", "\\fileserver\manuals\valve-2.pdf", or "http:\\www.example.com\test.pdf".

Zoom Factor

zoomFactor

FLOAT

link

The zoom factor of the viewer. 1=100%.

 

 

Customizer

None.

Events

mouse
mouseClicked
mouseEntered
mouseExited
mousePressed
mouseReleased
mouseMotion
mouseDragged
mouseMoved
propertyChange
propertyChange

 

 

 

Scripting Functions

 

 

setBytes(bytes)

Sets the PDF document to a byte array. Useful for loading a PDF document from a SQL database.

Parameters

 

bytes

 

The PDF byte array to display.

 

Example:

# This code would prompt the user to choose a pdf file. If the user chooses a file,
# it would then read that file into a byte array and call setBytes.
path = fpmi.file.openFile('pdf')
if path != None:
 bytes = fpmi.file.readFileAsBytes(path)
 pdfViewer.setBytes(bytes)

 

Example 2:

# This would get the PDF bytes from a SQL database
bytes = fpmi.db.runScalarQuery("SELECT PDFBlob FROM PDFTable WHERE ID = 1")
pdfViewer.setBytes(bytes)