Skip to end of metadata
Go to start of metadata
File Explorer and PDF Viewer



Component Palette Icon:

 

IULocgo


PDF Viewer

Description

Looking for documentation on the legacy PDF Viewer component? Please see the IA Labs PDF Viewer page


The PDF Viewer component displays a PDF that exists as a file in some accessible file system, or as a URL. Note that this component is simply for 
viewing existing PDFs. To create dynamic reports, or view dynamically generated reports use the Reporting Module.

This component is typically used in conjunction with the File Explorer component, in order to create a PDF viewing window. Simply bind the Selected Path property in the PDF Viewer to the File Explorer's Selected Path property. See the File Explorer's documentation, as well as the File Explorer and PDF Viewer page for further instructions on how to put these two components together. 

Using past versions of the PDF Viewer

Past versions of this component had some limitations on what it could present. In the Reporting Module versions 2.x, the PDF Viewer component could only be guaranteed to correctly display reports generated by the Report Viewer. In practice, it is able to view many PDFs, but it does have trouble with some, especially PDFs created by AutoCAD. Users unable to upgrade to Ignition 7.8 should consider installing the PDF-Viewer module from IA-Labs. This module is the basis on which the new 7.8 version of the PDF Viewer is built.

Properties

Name

Description

Property Type

Scripting

Category

BorderThe border surrounding this component. NOTE that the border is unaffected by rotation.Border.borderCommon
File PathPath to the .pdf file to be displayed.String.filePathData
Footer VisibleIf false, the Footer is not displayed.Boolean.footerVisibleAppearance
NameThe name of this component.String.nameCommon
Page Fit ModeMode to fit the document within the viewer. (1 = Disabled, 2 = Actual Size, 3 = Fit Height, 4 = Fit Width)Integer.pageFitModeAppearance
Page View ModeHow to display PDF in Viewer (1 = One Page, 2 = One Column, 3 = Two Page Left, 4 = Two Col Left, 5 = Two Page Right, 6 = Two Col Right)Integer.pageViewModeAppearance
Toolbar VisibleSets the top PDF control toolbar to visible.Boolean.toolBarVisibleAppearance
Utility VisibleSets the Utility Sidebar to visible.Boolean.utilityPaneVisibleAppearance
VisibleIf disabled, the component will be hidden.Boolean.visibleCommon
PDF Viewer Toolbar
Toolbar ButtonsNameFunction
Save AsWill save the currently loaded pdf to the local computer.
Print DocumentWill print the currently loaded pdf from the local computer.
Search DocumentWill open up a text field that can be used to search the currently loaded pdf for a specific word or phrase. *Note: This is located in the Utility Panel and can be accessed from there as well.
Show/Hide Utility Panel

Will show/hide the Utility panel. The Utility Panel contains the following tabs:

  • Search - Will search the document for a specific word or phrase.
  • Bookmarks - Will display all of the bookmarks for the loaded pdf and allow you to quickly jump to them.
  • Thumbnails - Will display a thumbnail view of all of the pages of the loaded pdf. Clicking on one will jump to it.
  • Annotations - Will create a multitude of annotations on the currently loaded pdf. After adding an annotation, it can be selected and then configured in the Utility Panel. Annotations include highlights, strike through, underlines, text notes, and actions like navigating to a url.
  • Layers - Will display the layers of the currently loaded pdf, if any.
First PageWill navigate back to the first page of the pdf.
Previous PageWill navigate back one page of the pdf.
Current Page NumberWill show the current page number out of the total number of pages, also allowing a page number to be entered which will jump to that page immediately.
Next PageWill navigate forward one page of the pdf.
Last PageWill navigate forward to the last page of the pdf.
Zoom OutWill zoom out from the pdf.
ZoomA drop down list that displays the current zoom, as well as giving the ability to switch between different preset zoom amounts.
Zoom InWill zoom in to the pdf.
Actual SizeWill revert back to a 100% zoom which is the natural size of the pdf.
Fit In WindowWill fit the pdf to the pdf viewer window.
Fit WidthWill fit the pdf to the width of the pdf viewer.
Rotate RightWill rotate the pdf right.
Rotate LeftWill rotate the pdf left.
Pan ToolWill pan around a page of the pdf by clicking and dragging. Works better when zoomed in.
Text Select ToolCan be used to select text in the pdf.
Zoom Marquee ToolWill zoom into the pdf by clicking and dragging to select an area.
Zoom Dynamic ToolWill zoom in and out using the scroll wheel.
Select ToolCan be used to select objects on the pdf such as annotations.
Highlight Annotation ToolCan be used to highlight text in the pdf. Can also be done from the Utility Panel and can be configured there as well.
Text Annotation ToolCan be used to place a text comment on the pdf. Can be configured in the Utility Panel.
Scripting
Scripting Functions

 .loadPDFBytes(bytes, name)
  • Description

This function will pass in the bytes of a PDF and load them into the PDF Viewer component. Please see Storing Files in a Database for more details

  • Parameters

string bytes - The bytes of the PDF to be displayed on the component

string name - The name of the PDF

  •  Return

Nothing

  • Scope

Client

 .print(showDialog)
  • Since 7.8.2

  • Description

This function will print the PDF.

  • Parameters

boolean showDialog- If true, shows the user a print dialog. Default is true [optional]

  • Return

Nothing

  • Scope

Client

 .setZoomFactor(zoom)
  • Since 7.8.2

  • Description

This function will set the current zoom level of the PDF, adjusted to stay within the minimum / maximum zoom range. Will zoom in on center of page.

  • Parameters

float zoom- Zoom factor to use. 1.0 is no zoom.

  • Return

Nothing

  • Scope

Client

Extension Functions

This component does not have extension functions associated with it.

Event Handlers
 mouse
 mouseClicked

This event signifies a mouse click on the source component. A mouse click the combination of a mouse press and a mouse release, both of which must have occurred over the source component. Note that this event fires after the pressed and released events have fired.

.sourceThe component that fired this event.
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Control key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.
 mouseEntered

This event fires when the mouse enters the space over the source component.

.sourceThe component that fired this event.
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Control key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.
 mouseExited

This event fires when the mouse leaves the space over the source component.

.sourceThe component that fired this event.
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Control key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.
 mousePressed

This event fires when a mouse button is pressed down on the source component.

.sourceThe component that fired this event.
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Control key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.
 mouseReleased

This event fires when a mouse button is released, if that mouse button's press happened over this component.

.sourceThe component that fired this event.
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Control key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.
 mouseMotion
 mouseDragged

Fires when the mouse moves over a component after a button has been pushed.

.sourceThe component that fired this event.
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Control key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.
 mouseMoved

Fires when the mouse moves over a component, but no buttons are pushed.

.sourceThe component that fired this event.
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Control key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.
 propertyChange
 propertyChange

Fires whenever a bindable property of the source component changes. This works for standard and custom (dynamic) properties.

.sourceThe component that fired this event.
.newValueThe new value that this property changed to.
.oldValueThe value that this property was before it changed. Note that not all components include an accurate oldValue in their events.
.propertyNameThe name of the property that changed. NOTE: remember to always filter out these events for the property that you are looking for! Components often have many properties that change.
Customizers

The PDF Viewer component does not have a special customizer, however, it does use the Style Customizer and Custom Properties.

Examples

Refer to the example on the Vision Reporting Components page.

  • No labels