Skip to main content

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.v23.2.dll

NuGet Package: DevExpress.Wpf.PdfViewer

Declaration

public class PdfViewerControl :
    DocumentViewerControl,
    IPdfViewer

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.

<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.

See Also