wpf-devexpress-dot-xpf-dot-pdfviewer-dot-pdfviewercontrol-dot-opendocument-x28-system-dot-string-x29.md
Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.
Opens a PDF document.
Namespace : DevExpress.Xpf.PdfViewer
Assembly : DevExpress.Xpf.PdfViewer.v25.2.dll
NuGet Package : DevExpress.Wpf.PdfViewer
public override void OpenDocument(
string filePath = null
)
Public Overrides Sub OpenDocument(
filePath As String = Nothing
)
| Name | Type | Default | Description |
|---|---|---|---|
| filePath | String | null |
A string specifying the path to the PDF document.
|
If the PdfViewerControl.DetachStreamOnLoadComplete property is set to false (default mode) the PDF Viewer locks a file until it is opened in the PDF Viewer. If you want the PDF Viewer does not lock the file, set the PdfViewerControl.DetachStreamOnLoadComplete property to true.
The following code snippets (auto-collected from DevExpress Examples) contain references to the OpenDocument(String) method.
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.cs#L12
// Load a document.
viewer.OpenDocument("..\\..\\Demo.pdf");
}
wpf-pdf-viewer-import-and-export-acroform-data/CS/MainWindow.xaml.cs#L11
InitializeComponent();
Viewer.OpenDocument("FormFillDemo.pdf");
}
wpf-pdf-viewer-customize-the-popup-menu/VB/MainWindow.xaml.vb#L14
' Load a document.
viewer.OpenDocument("..\..\Demo.pdf")
End Sub
wpf-pdf-viewer-import-and-export-acroform-data/VB/MainWindow.xaml.vb#L12
InitializeComponent()
Viewer.OpenDocument("FormFillDemo.pdf")
End Sub
See Also