[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Collapse]PDF Viewer
    Deployment
    Getting Started
    Coordinate Systems
   [Expand]Additional Content
    Printing
   [Expand]Interactive Forms
   [Expand]Manipulate Document Content
    Adjust the Document View
   [Expand]Visual Elements
   [Expand]Examples
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Adjust the Document View

The topic consists of the following sections:

Expanded Browse Document Pages

Use the PdfViewer.CurrentPageNumber property to change the current page, as shown below. The PdfViewer.PageCount property returns the total number of document pages.

The PdfViewer.CurrentPageChanged event occurs when an end user moves to another page. Handle this event to obtain the current page number and the total number of pages.

Page Navigation in the User Interface

PDF Viewer provides the following ways to browse document pages.

  • Next and Previous buttons;

  • The Pager used to show the current page number and the total number of pages. Type a required page number and press ENTER to go to this page.

  • The Page Thumbnails panel on the Navigation Pane. Click a page thumbnail to go to the required page.

Expanded Rotate a Document

Use the PdfViewer.RotationAngle property to rotate document pages. The RotationAngle property can have one of the following values: 0, 90, 180, 270. Otherwise, an ArgumentOutOfRangeException occurs. The code sample below rotates the loaded document counter-clockwise.

Note

The PDF Viewer does not provide and API or User Interface features to rotate individual pages. Use PDF Document API instead.

The PDF Document API is a part of the Office File API or Universal subscription only, and is not included in the WinForms subscription. Please refer to the DevExpress Subscription page for pricing information.

Rotate a Document: Built-in UI Commands

End users can use Rotate Clockwise and Rotate Counterclockwise items from the context menu to rotate document pages. You can also use Ctrl + Shift + Add and Ctrl + Shift + Subtract shortcuts.

Expanded Zoom a Document

The following properties allow you to zoom in and out of a document.

API Description
PdfViewer.ZoomMode Specifies the zoom mode. When the property is set to PdfZoomMode.Custom, the PdfViewer.ZoomFactor property defines the document zoom factor value.
PdfViewer.MinZoomFactor Obtains minimum allowed zoom factor.
PdfViewer.MaxZoomFactor Obtains maximum allowed zoom factor.

The code sample below changes the zoom factor to 150 percent.

When the document's zoom is changed, the PdfViewer.ZoomChanged event occurs. The event args allows you to obtain current zoom mode and zoom factor.

Zoom a Document: Built-in UI Commands

Use buttons on the Zoom ribbon group on the PDF Viewer tab to zoom a document.

You can press Ctrl+Plus and Ctrl+Minus, or hold Ctrl and rotate the mouse wheel to zoom a page.

Use Marquee Zoom Tool

The Marquee Zoom tool allows end users to zoom a particular part of the page.

Right-click the document and select the Marquee Zoom item in the context menu to activate the tool.

Set PdfViewer.CursorMode property to PdfCursorMode.MarqueeZoom to activate the marquee zoom in code.

Drag a rectangle around the page area to zoom in on it. Click the area to increase the zoom level. Click while pressing the Ctrl key to decrease the zoom level.

Expanded Previous and Next View

Execute the PdfPreviousViewCommand (see PdfPreviousViewCommand) or PdfNextViewCommand (see PdfNextViewCommand) command to switch between recently used page display styles (that is, previous zoom factor, rotation angle, and page display mode). If the page display options were not changed, the PDF Viewer shows the previously displayed page.

Previous and Next View in the User Interface

Previous View and Next View items allows you to navigate between recently used page display styles.

You can also use Alt+Left or Alt+Right shortcuts to go to previous views and pages. Note that the PDF Viewer shows these pages in reverse order.

Is this topic helpful?​​​​​​​