PdfViewer Component Properties, Methods, and Events

The PdfViewer component lets you display a PDF file to a Runtime user on a Windows form. The Runtime user can interact with the PDF file or you can interact with the PDF file on behalf of the user via automation code.

The PdfViewer component lets you search for text, select text, zoom in or out, and print the PDF file. You can respond to click events within the text of a file to provide assistance to the Runtime user.

Note: In PDF files, left and right coordinates are offsets from the left of the page. Bottom and top coordinates are offsets from the bottom of the page.

This component is often used with the PdfConnector component.

Properties

Property

Description

FileName

Specify the name of the PDF file.

SearchHighlightMode

I indicate whether a search should highlight all found items or only the currently selected item.

SelectedText

(Read-only) Returns the currently selected text.

SelectedTextPageNumber

(Read-only) Returns the page number of the currently selected text.

SelectedTextLeft

(Read-only) Returns the currently selected text’s left position.

SelectedTextRight

(Read-only) Returns the currently selected text’s right position.

SelectedTextTop

(Read-only) Returns the currently selected text’s top position.

SelectedTextBottom

(Read-only) Returns the currently selected text’s bottom position.

SelectingColor

Specify the color to use to highlight the rectangle the system creates when you click and drag to create a selection area.

SelectedColor

Specify  the color to use to highlight the selected text.

SearchResultColor

Specify the color to use to highlight text for search results when it is not the current selection. Only use this property if you set the SearchHighlightMode property All.

ToolbarPageSection

Indicate whether the page section of the toolbar should be visible.

ToolbarZoomSection

Indicate whether the zoom section of the toolbar should be visible.

ToolbarRotateSection

Indicate whether the rotate section of the toolbar should be visible.

ToolbarSearchSection

Indicate whether the search section of the toolbar should be visible.

ToolbarDevSection

Indicate whether the dev section of the toolbar should be visible.

ToolbarFileSection

Indicate whether the file section of the toolbar should be visible.

ToolbarSectionOrder

Indicate the order of the sections of the toolbar.

Connector

Use this property at design time to associate a PdfConnector with this PdfViewer.

ConnectorInstance

Use this property from the automation code to associate a PdfConnector with this PdfViewer by assigning the PdfConnector’s This property.

ShowBookmarks

Turn on or turn off the display of bookmarks.

 

Methods

Method

Description

Return type

Reload()

Loads the PDF file again.

void

Close()

Closes the PDF file.

void

Search(string searchFor)

Searches for the string you specify.

bool

Search(PdfLine line)

Selects and highlights text based on a PdfConnector PdfLine object.

bool

Search(PdfSegment segment)

Selects and highlights text based on a PdfConnector PdfSegment object.

bool

Search(PdfWord word)

Selects and highlights text based on a PdfConnector PdfWord object.

bool

Search(PdfPhrase phrase)

Selects and highlights text based on a PdfConnector PdfPhrase object.

bool

SearchNext()

Repeats the search, going forward.

bool

SearchPrev()

Repeats  the search, going backwards.

bool

GotoPage(int pageNumber)

Goes to the page number you specify.

void

GotoLine(PdfLine line)

Use to position to the text based on the PdfConnector PdfLine object.

void

GotoSegment(PdfSegment segment)

Use to position to the text based on the PdfConnector PdfSegment object.

void

GotoWord(PdfWord word)

Use to position to the text based on the PdfConnector PdfWord object.

void

GotoPhrase(PdfPhrase phrase)

Use to position to the text based on the PdfConnector PdfPhrase object.

void

PrevPage()

Goes to the previous page.

void

NextPage()

Goes to the next page.

void

SetZoom(float zoom)

Specifies a zoom percentage.

void

ZoomIn()

Use to zoom in.

void

ZoomOut()

Use to zoom out.

void

RotateLeft()

Rotates the PDF file 90 degrees to the left (counter clockwise).

void

RotateRight()

Rotates the PDF file 90 degrees to the right (clockwise).

void

FitWidth()

Zooms  the PDF document so it fits the width of the viewer.

void

FitHeight()

Zooms the PDF document so it fits the height of the viewer.

void

CopySelectionToClipboard()

Copies the current selection to the clipboard.

void

Events

Event

Description

TextSelected

Occurs when text is selected.

SelectionChanged

Occurs when text is selected or unselected.

 

 


Privacy | Trademarks | Terms of Use | Feedback

Updated: 18 June 2020

© 2016 - 2020 Pegasystems Inc.  Cambridge, MA All rights reserved.

 

OpenSpan data classification label