A newer version of this page is available. Switch to the current version.

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

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>
See Also