PdfViewer.LoadDocument(Stream) Method
Loads a PDF document from the specified stream.
Namespace: DevExpress.XtraPdfViewer
Assembly: DevExpress.XtraPdfViewer.v24.2.dll
NuGet Package: DevExpress.Win.PdfViewer
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
stream | Stream | A Stream class descendant. |
#Example
The following example illustrates how to load a document into the PDF Viewer from a stream at runtime.
Create a FileStream object with the specified file path to open the existing file, and call one of the PdfViewer.LoadDocument overloaded method with this stream object passed as a parameter.
Note
The PDF Viewer expects that the input stream is not modified or closed before the component finishes using a document. Set true
as the Pdf
using System.IO;
using System.Windows.Forms;
namespace LoadDocumentFromStream {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
// Load a document from the stream.
FileStream stream = new FileStream("..\\..\\Demo.pdf", FileMode.Open);
pdfViewer1.LoadDocument(stream);
}
}
}
#Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the LoadDocument(Stream) 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.