Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

PdfDocumentProcessor.CreateEmptyDocument(Stream) Method

Creates an empty PDF document with no pages using a stream.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v19.1.dll

Declaration

public void CreateEmptyDocument(
    Stream stream
)

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. The empty document is created using a stream.

Then, you can continue to generate the document layout (e.g., append pages with graphics to the PDF document, generate bookmarks, and attach files) using the PDF document creation API. For more information, see the Additional Content topic.

Note

When all operations with a document created using the overloaded CreateEmptyDocument method are completed, you need to close the document either by calling the PdfDocumentProcessor.CloseDocument method or disposing 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.

See Also