Skip to main content

Toolbar Commands and Dialogs

  • 4 minutes to read

The Document Preview provides the following toolbars by default:

Each toolbar button triggers a specific command. The available commands are grouped into several categories.

File Commands:

Button Command Description
Open DocumentPreviewControl.OpenDocument Invokes the Open dialog for loading a document from a specified file.
Save DocumentPreviewControl.SaveCommand Invokes the Save As dialog for saving a document to a PRNX file.

Print Commands:

Button

Command

Description

Print…

DocumentPreviewControl.PrintCommand

Opens the Print dialog for printing a document.

wpf-preview-print-dialog

Quick Print

DocumentPreviewControl.PrintDirectCommand

Prints a document using the system’s default printer.

Page Setup…

DocumentPreviewControl.PageSetupCommand

Invokes the Page Setup dialog for specifying a document’s page settings.

page-setup-dialog-wpf

Scale

DocumentPreviewControl.ScaleCommand

Opens the Scale dialog for specifying a document’s scaling options.

wpf-preview-scale-dialog

Navigation Commands:

Button Command Description
First Page DocumentPreviewControl.FirstPageCommand Navigates to a document’s first page.
Previous Page DocumentViewerControl.PreviousPageCommand Navigates to a document’s previous page.
Next Page DocumentViewerControl.NextPageCommand Navigates to a document’s next page.
Last Page DocumentPreviewControl.LastPageCommand Navigates to a document’s last page.
Navigation Pane DocumentPreviewControl.ToggleNavigationPaneCommand Opens the Navigation Pane for navigation through a document and search for text.

Zoom Commands:

Button

Command

Description

Zoom Out

DocumentViewerControl.ZoomOutCommand

Decreases a document’s zoom factor.

Zoom

DocumentViewerControl.SetZoomFactorCommand

DocumentViewerControl.SetZoomModeCommand

Enables you to select a document’s zoom factor or specify the zoom mode.

wpf-preview-zoom-command

Zoom In

DocumentViewerControl.ZoomInCommand

Increases a document’s zoom factor.

View Commands:

Button

Command

Description

Page Layout

DocumentPreviewControl.SetPageLayoutCommand

Enables you to select a document’s page view:

  • Single Page

    Displays one document page at a time.

  • Two Pages

    Displays two document pages side-by-side.

  • Wrap Pages

    Displays pages side-by-side (the current zoom factor limits the number).

These settings affect the following property values:

Enable Continuous Scrolling

DocumentPreviewControl.ToggleEnableContinuousScrollingCommand

Specifies whether to skip to the beginning of the next page on reaching the end of the previous page, or enables continuous vertical scrolling.

This command is enabled only when the Page Layout is set either to Single Page or Two Pages.

Show Cover Page

DocumentPreviewControl.ToggleShowCoverPageCommand

Specifies whether to display the first document page separately or alongside the next document page.

This command is enabled only when the Page Layout is set to Two Pages.

Export Commands:

Button

Command

Description

Export…

DocumentPreviewControl.ExportCommand

Runs the Export Document dialog for exporting a document to a selected format and specifying the format-specific options.

wpf-preview-export-document-dialog

Send…

DocumentPreviewControl.SendCommand

Invokes the Send via E-Mail dialog for sending a document by e-mail in a selected format and specifying the format-specific options.

wpf-preview-send-via-email-dialog

You can remove an item from the list of available export formats by adding it to the DocumentPreviewControl.HiddenExportFormats collection.

Document Commands:

Most of the following commands toggle various Document Preview panels’ visibility and interactive document features described in the Document Preview Panels document.

Button

Command

Description

Parameters

DocumentPreviewControl.ToggleParametersPanelCommand

Toggles the Parameters panel’s visibility.

Document Map

DocumentPreviewControl.ToggleDocumentMapCommand

Toggles the Document Map panel’s visibility.

The DocumentViewerControl.NavigateCommand enables you to navigate to a specific location in a document, corresponding to the item selected in the Document Map.

This button is visible if the DocumentPreviewControl.UseOfficeInspiredNavigationPane property is disabled.

Thumbnails

DocumentPreviewControl.ToggleThumbnailsCommand

Toggles the Thumbnails panel’s visibility.

This button is visible if the DocumentPreviewControl.UseOfficeInspiredNavigationPane property is disabled.

Editing Fields

DocumentPreviewControl.ToggleEditingFieldsCommand

Highlights a document’s editing fields.

This command corresponds to the DocumentPreviewControl.HighlightEditingFields property.

Search

DocumentViewerControl.ShowFindTextCommand

Toggles the Search panel’s visibility.

This button is visible if the DocumentPreviewControl.UseOfficeInspiredNavigationPane property is disabled.

The DocumentViewerControl.FindTextCommand allows you to search for text within a displayed document.

Watermark

DocumentPreviewControl.SetWatermarkCommand

Opens the Watermark dialog for specifying a text and/or picture watermark for a document’s pages.

wpf-preview-watermark-dialog

Status Bar

The Document Preview provides a status bar displaying the current page number, the document build progress (while document pages are being created) and the document zoom factor.

wpf-preview-status-bar

The status bar actions correspond to the following commands.

Context Menu

Right-clicking a loaded document invokes a context menu where you can switch the cursor mode or copy the selected document content.

wpf-preview-context-menu

These actions correspond to the following commands:

Tip

See Quick Guide to Print Preview Customization to learn how to customize the Document Viewer’s commands and dialogs.