Back to Devexpress

PdfViewer Class

windowsforms-devexpress-dot-xtrapdfviewer.md

latest4.6 KB
Original Source

PdfViewer Class

Represents the PDF Viewer, which displays PDF files in WinForms applications.

Namespace : DevExpress.XtraPdfViewer

Assembly : DevExpress.XtraPdfViewer.v25.2.dll

NuGet Package : DevExpress.Win.PdfViewer

Declaration

csharp
[DXLicenseWinForms]
public class PdfViewer :
    XtraUserControl,
    ICommandAwareControl<PdfViewerCommandId>,
    IServiceProvider,
    IServiceContainer,
    IPdfViewer
vb
<DXLicenseWinForms>
Public Class PdfViewer
    Inherits XtraUserControl
    Implements ICommandAwareControl(Of PdfViewerCommandId),
               IServiceProvider,
               IServiceContainer,
               IPdfViewer

Remarks

This is a primary control for the PDF Viewer. The PdfViewer allows end users to open, view, navigate and print PDF documents.

Refer to the following examples on how to load documents to the PdfViewer:

The PDfViewer allows you to work with interactive forms and markup annotations. You can attach images, modify bookmarks, thumbnails and hyperlinks in the PDF file.

Refer to the following section for a list of task-based examples: PDF Viewer Examples

Example

The following example illustrates how to load a PDF file into the PdfViewer control. Drop the PdfViewer control onto the form, create a Ribbon via the PdfViewer’s smart tag and call the PdfViewer.LoadDocument method.

View Example

csharp
using System;
using System.Windows.Forms;

namespace PdfViewerSample {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e) {
            this.pdfViewer1.LoadDocument(@"..\..\Report.pdf");
        }
    }
}
vb
Imports System
Imports System.Windows.Forms

Namespace PdfViewerSample
    Partial Public Class Form1
        Inherits Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
            Me.pdfViewer1.LoadDocument("..\..\Report.pdf")
        End Sub
    End Class
End Namespace

Implements

IXtraResizableControl

Inheritance

Object MarshalByRefObject Component Control ScrollableControl ContainerControl UserControl XtraUserControl PdfViewer

See Also

PdfViewer Members

Get Started with WinForms PDF Viewer (.NET Framework)

DevExpress.XtraPdfViewer Namespace