Back to Devexpress

PdfViewerControl Class

wpf-devexpress-dot-xpf-dot-pdfviewer-f6316b43.md

latest5.7 KB
Original Source

PdfViewerControl Class

A control to display PDF files in a WPF application without the need to install any third-party software on end user machines.

Namespace : DevExpress.Xpf.PdfViewer

Assembly : DevExpress.Xpf.PdfViewer.v25.2.dll

NuGet Package : DevExpress.Wpf.PdfViewer

Declaration

csharp
[DXLicenseWpf]
public class PdfViewerControl :
    DocumentViewerControl,
    IPdfViewer,
    IServiceContainer,
    IServiceProvider
vb
<DXLicenseWpf>
Public Class PdfViewerControl
    Inherits DocumentViewerControl
    Implements IPdfViewer,
               IServiceContainer,
               IServiceProvider

The following members return PdfViewerControl objects:

Remarks

This control provides the UI for end users to open, view, navigate and print PDF documents.

To load a PDF document in code, use the DocumentViewerControl.DocumentSource or DocumentViewerControl.OpenDocument property.

Refer to the Getting Started section for a step-by-step tutorial on how to create a new PDF application and provide it with a command UI.

Refer to the Examples section for task-based code examples.

The code sample below creates a PDF application with a bar command UI and bound document.

xaml
<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:PDF_Viewer"
        xmlns:dxpdf="http://schemas.devexpress.com/winfx/2008/xaml/pdf" x:Class="PDF_Viewer.MainWindow"
        mc:Ignorable="d"
        Title="PDF Viewer" x:Name="pdfViewer" Height="350" Width="525">
    <Grid>
        <dxpdf:PdfViewerControl x:Name="pdfViewer"
                                CommandBarStyle="Bars"
                                DocumentSource="..\\..\\Data\Demo.pdf"/>
    </Grid>
</Window>

The following code snippets (auto-collected from DevExpress Examples) contain references to the PdfViewerControl class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-pdf-viewer-customize-the-popup-menu/CS/MainWindow.xaml#L12

xml
<dxpdf:PdfViewerControl x:Name="viewer" PopupMenuShowing="Viewer_PopupMenuShowing"/>

wpf-pdf-viewer-create-text-markup-annotation-and-specify-its-properties/CS/MarkupAnnotations/MainWindow.xaml#L11

xml
<dxpdf:PdfViewerControl x:Name="viewer" DocumentLoaded="viewer_DocumentLoaded">
        <dxpdf:PdfViewerControl.MarkupToolsSettings>

wpf-pdf-viewer-draw-a-rectangle-over-a-document/CS/MainWindow.xaml#L23

xml
</Grid.ColumnDefinitions>
<dxpdf:PdfViewerControl
    x:Name="pdfView"

wpf-pdf-viewer-replace-standard-command-with-custom-command/CS/MainWindow.xaml#L19

xml
<pdfViewer:PdfViewerControl x:Name="pdfViewer" DocumentSource="Demo.pdf">

wpf-pdf-viewer-import-and-export-acroform-data/CS/MainWindow.xaml#L12

xml
<Grid>
    <dxpdf:PdfViewerControl
        x:Name="Viewer"

Inheritance

Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control DocumentViewerControl PdfViewerControl

See Also

PdfViewerControl Members

DevExpress.Xpf.PdfViewer Namespace