[Expand]General Information
[Collapse]WinForms Controls
  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]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)

Getting Started

This tutorial illustrates how to create a simple PDF Viewer application with and adjust its appearance.

The tutorial consists of the following sections.

Expanded Create a PDF Viewer Application

  1. Run Microsoft® Visual Studio and create a new Windows Forms Application project.

  2. Drop the PdfViewer item from the DX.19.1: Common Controls toolbox tab onto the form.

  3. Click the PDF Viewer's smart tag and select Dock in parent container in the PDFViewer Tasks menu. This allows the PDF Viewer to expand to the form's size.

  4. Load a document to the PDF Viewer. Click the PdfViewer's smart tag to invoke its actions list. In the Actions list, click the Load PDF file... link.

    The Open dialog box appears. In this dialog, locate the document to be opened and click Open.

Expanded Create Command UI

Design Time

  1. Select Create Ribbon in the PDFViewer Tasks menu to add a RibbonControl to the PdViewer.

  2. Select necessary ribbon pages in the PdfViewer Tasks menu or click Create All Bars to add all available ribbon pages at once. You can customize the created ribbon afterward: change the ribbon style, add new ribbon elements, modify or remove the existing items.

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

Runtime

Use the PdfViewer.CreateRibbon or PdfViewer.CreateBars method overloads to add a ribbon or a bar manager to the PdfViewer at runtime.

Result

Run the application and try the PDF Viewer features. Load and navigate the document, highlight text, check the attachments or print the result.

Note

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 theAttachments and Page Thumbnails panels on the navigation pane.

Expanded Change the Application's Appearance

Change the Application's Skin

At Design Time

In Code

Invoke the DevExpress Project Settings page and select a desired skin in the Skin Options group.

Call the UserLookAndFeel.Default static object's UserLookAndFeel.SetSkinStyle method:

Use Bitmap or Vector Icons

The newly created PDF Viewer application uses vector icons. This ensures that the application is rendered correctly on high-DPI devices.

Set the static WindowsFormsSettings.AllowDefaultSvgImages property to DefaultBoolean.False at the application's startup to use bitmap icons in your application.

The following images illustrate the standard PDF Viewer's ribbon UI with default vector and bitmap icons:

  • SVG Icons

  • Bitmap Icons

Use Skinned Open/Save File Dialogs

You can replace standard WinForms Open File and Save File dialogs with skinned DevExpress counterparts.

Set the static WindowsFormsSettings.UseDXDialogs property to DefaultBoolean.False at the application's startup to enable skinned dialogs in your application.

Note

Add the required assembly references to use skinned DevExpress dialogs. Refer to the Deployment topic for more information.

Expanded See Also

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