Skip to main content
You are viewing help content for pre-release software. This document and the features it describes are subject to change. .

PDF Viewer Toolbar Commands

  • 3 minutes to read

The built-in PDF viewer toolbar allows you to show a search box, switch display modes, and invoke Thumbnail and Outline views. If the default toolbar does not meet your requirements, you can set the ShowToolbar to false to hide it. To implement a custom toolbar, you can use the PDF viewer’s commands listed below:

Show, Share and Close Commands

ShowOpenFileDialog
Returns the command that invokes the file explorer to select a PDF file to open.
ShareDocument
Returns the command that invokes a share UI prompting the user to choose an app to share with.
CloseDocument
Returns the command that closes the document.
GoToFirstPage
Returns the command that navigates the document to the first page.
GoToLastPage
Returns the command that navigates the document to the last page.
GoToNextPage
Returns the command that navigates the document to the next page.
GoToPreviousPage
Returns the command that navigates the document to the previous page.

Search Commands

SearchBackward
Returns the command that searches the text string passed in parameters backward in the document starting from the previous page.
SearchForward
Returns the command that searches the text string passed in parameters forward in the document starting from the current page.

Show Outlines and Thumbnails

ToggleOutlines
Returns the command that invokes the built-in Outlines page.
ToggleThumbnails
Returns the command that invokes the built-in Thumbnails page.

Zoom Commands

ZoomIn
Returns the command that zooms in the current document.
ZoomOut
Returns the command that zooms out of the current document.

Selection Commands

ClearSelection
Returns the command that resets the selection.
CopySelection
Returns the command that copies the selected content to the clipboard.

Text Effect Commands

HighlightSelectedText
Returns the command that highlights the selected text with a filled rectangle.
SquiggleSelectedText
Returns the command that underlines the selected text with a squiggle line.
StrikethroughSelectedText
Returns the command that applies strikethrough to the selected text.
UnderlineSelectedText
Returns the command that underlines the selected text with a straight line.

Annotation Commands

DeleteSelectedAnnotation
Returns the command that removes the selected annotation.
SelectNextAnnotation
Returns the command that selects the next annotation in the current document.
SelectPreviousAnnotation
Returns the command that selects the previous annotation in the current document.
ToggleComments
Returns the command that invokes the built-in view that lists annotations with associated comments.

Example

The following example implements a custom toolbar that allows users to invoke the system file explorer:

<Grid RowDefinitions="40,*">
    <dxm:DXToolbar Grid.Row="0">
        <dxm:ToolbarButton Icon="open" Command="{Binding Commands.ShowOpenFileDialog, Source={x:Reference pdfViewer}}"/>
    </dxm:DXToolbar>
    <dxpdf:PdfViewer x:Name="pdfViewer" Grid.Row="1" ShowToolbar="False"/>
</Grid>