Skip to main content

PdfDocumentProcessor.SaveDocument(Stream, Boolean) Method

Saves the current PDF document to the specified stream using the detach stream mode.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v23.2.dll

NuGet Package: DevExpress.Document.Processor


public void SaveDocument(
    Stream stream,
    bool detachStream


Name Type Description
stream Stream

A Stream object that is the stream to which the PDF document is saved.

detachStream Boolean

true, the PDF Document API component completes all operations after saving a document; false, the output stream should not be modified or closed while a PDF document is saved.


When you dispose of an output stream that has not been detached, an attempt to apply further changes to a document may cause errors. Pass true as the detachStream method parameter to safely close the stream when a document is saved.

Using the same stream for loading and saving a document may cause unpredictable results if the detachStream parameter is set to false.


The PdfDocumentProcessor removes existing signatures from a document when it is saved. However, if you use PdfDocumentProcessor to apply a signature, it is retained.

See Also