PdfDocumentProcessor.CreateEmptyDocument(Stream) Method
Creates an empty PDF document with no pages and writes it to a stream.
Namespace: DevExpress.Pdf
Assembly: DevExpress.Docs.v20.2.dll
NuGet Package: DevExpress.Document.Processor
Declaration
Parameters
Name | Type | Description |
---|---|---|
stream | Stream | A Stream class descendant specifying the stream to which the PDF empty document should be written. |
Remarks
Use this method to create an empty document and write it to a stream.
Use the PDF document creation API to continue to generate the document layout (e.g., append pages with graphics to the PDF document, generate bookmarks, and attach files). Refer to the following topic for more information: Additional Content
Note
When all operations with a created completed are completed, you need to close the document. Call the PdfDocumentProcessor.CloseDocument method or dispose of the PdfDocumentProcessor instance.
The PDF specification does not describe empty documents. For this reason, most third-party PDF viewers cannot open such files. This does not apply to the DevExpress WinForms PDF Viewer and WPF PDF Viewer, which are less demanding concerning the validity of opened documents, and are capable of opening documents containing no pages.
This CreateEmptyDocument method overload writes generated document content into the stream specified as this method’s parameter. The SaveDocument method call rewrites this stream.