[Expand]General Information
[Collapse]WinForms Controls
 [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]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Collapse]PDF Viewer
   [Collapse]Getting Started
     Lesson 1 - Creating a PDF Viewer
     Lesson 2 - Loading a Document
    Coordinate Systems
   [Expand]Access and Edit Document Content
  [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]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Lesson 1 - Creating a PDF Viewer

This tutorial illustrates how to embed a PDF Viewer in a Windows Forms application, to open, preview, navigate and print PDF documents without the need to install third-party software on the machine.

The tutorial consists of the following sections.

Expanded Create an Application and Add a PDF Viewer

  1. Run Microsoft® Visual Studio® 2012, 2013, 2015 or 2017.

  2. Start a new project (by pressing CTRL+SHIFT+N), and create a new Windows Forms Application.

  3. Open the Visual Studio designer and press CTRL+ALT+X to run the Toolbox. Expand the DX.18.2: Common Controls category, and drop the PdfViewer control onto the main form of the application.

  4. Click the PDF Viewer's smart tag to invoke its actions list. In the actions list, click the Dock in parent container link. This allows the PDF Viewer to occupy all of the available space on the form.

  5. After docking the PDF Viewer, it will appear as follows.

Expanded Create and Customize a PDF Viewer Toolbar

To add a toolbar to the PDF Viewer, click the control's smart tag, and in the invoked actions list, select one of the following.

  • Create Ribbon

    Then, click the Create All Bars link in the actions list.

    This creates a ribbon illustrated in the following image.


    To create only PDF Viewer bar, Interactive Form bar or Comment bar, choose the corresponding link in the actions list.

    You can fully customize the ribbon afterwards, as well as select a different look and feel for it, via the smart tag of the toolbar.

  • Create Bars

    Instead of creating a ribbon, you can implement a bar interface. You can upgrade it to the ribbon interface at any time (e.g., when converting the entire application).

Expanded Load and Preview a PDF File

To load a document into the PDF Viewer, click the control's smart tag and select Load PDF file... in the actions list that is invoked.

To learn more about several ways of loading a document in the PDF Viewer, refer to the Lesson 2 - Loading a Document tutorial.


The PDF Viewer shows bookmarks within its navigation pane for a document that contains them. So you can quickly locate and link to points of interest within a document. For more information, see the Bookmarks topic.

You can also see file attachments and thumbnails in the Attachments and Page Thumbnails panels on the navigation pane. For more information, see File Attachment, and Thumbnails topics.

Run the application and explore the PDF Viewer functionality.

Expanded See Also

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