PdfViewer.LoadDocument(String) Method

Loads the PDF document from the specified path.

Namespace: DevExpress.XtraPdfViewer

Assembly: DevExpress.XtraPdfViewer.v20.2.dll

Declaration

public void LoadDocument(
    string path
)
Public Sub LoadDocument(
    path As String
)

Parameters

Name Type Description
path String

A string specifying the path to the PDF document.

Remarks

The PDF Viewer locks a file until it is opened in the PDF Viewer. Set the PdfViewer.DetachStreamAfterLoadComplete property to true to keep the file unlocked.

Examples

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.

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");
        }
    }
}
See Also