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… | Opens the Print dialog for printing a document. | |
Quick Print | Prints a document using the system’s default printer. | |
Page Setup… | Invokes the Page Setup dialog for specifying a document’s page settings. | |
Scale | Opens the Scale dialog for specifying a document’s scaling options. |
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 | Decreases a document’s zoom factor. | |
Zoom | Enables you to select a document’s zoom factor or specify the zoom mode. | |
Zoom In | Increases a document’s zoom factor. |
View Commands:
Button | Command | Description |
---|---|---|
Page Layout | Enables you to select a document’s page view:
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 | 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… | Runs the Export Document dialog for exporting a document to a selected format and specifying the format-specific options. | |
Send… | Invokes the Send via E-Mail dialog for sending a document by e-mail in a selected format and specifying the format-specific options. |
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 | Toggles the Parameters panel’s visibility. | |
Document Map | 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 | Toggles the Thumbnails panel’s visibility. This button is visible if the DocumentPreviewControl.UseOfficeInspiredNavigationPane property is disabled. | |
Editing Fields | Highlights a document’s editing fields. This command corresponds to the DocumentPreviewControl.HighlightEditingFields property. | |
Search | 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 | Opens the Watermark dialog for specifying a text and/or picture watermark for a document’s pages. |
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.
The status bar actions correspond to the following commands.
DocumentPreviewControl.StopPageBuildingCommand
Corresponds to the Stop button displayed while a document is being created enabling you to interrupt the document creation process.
DocumentViewerControl.SetPageNumberCommand
Allows you to jump to a specific document page.
Context Menu
Right-clicking a loaded document invokes a context menu where you can switch the cursor mode or copy the selected document content.
These actions correspond to the following commands:
DocumentPreviewControl.SetCursorModeCommand
Switches the cursor to the content selection or a hand scrolling mode.
Use the DocumentPreviewControl.HasSelection property to determine if any document content is currently selected.
DocumentPreviewControl.CopyCommand
Copies the selected text to the clipboard.
Tip
See Quick Guide to Print Preview Customization to learn how to customize the Document Viewer’s commands and dialogs.