Skip to main content

TdxPDFDocument.SaveToStream(TStream,Boolean,Boolean) Method

Saves the document to a stream.

Declaration

procedure SaveToStream(AStream: TStream; AAllowSignatureRemoval: Boolean = False; AResetModified: Boolean = True);

Parameters

Name Type Description
AStream TStream

The target stream object.

AAllowSignatureRemoval Boolean

Optional. If True, the procedure removes all digital signatures that the document already has; otherwise, the procedure raises an exception.

AResetModified Boolean

Optional. If True, the procedure resets the Modified property to False.

Remarks

Call this procedure to save all changes made in the document. A SaveToStream procedure call raises the OnSaveProgress event multiple times, every time certain PDF objects in the document are successfully saved. The number of event occurrences depends on the size and complexity of the document.

The SaveToStream procedure can:

The SaveToStream procedure cannot save a document with multiple digital signatures or preserve a loaded signature. If the source document has one or more digital signatures, a SaveToStream procedure call raises the EdxPDFException exception that shows the following message: “The document has a digital signature and cannot be saved. To remove the signature and save the document, call the method again and pass True as the AAllowSignatureRemoval parameter.” Follow the instructions in the message to avoid this exception and save the document without imported digital signatures.

Important

The current SaveToStream procedure implementation cannot use the AES encryption algorithm to protect a saved document and raises the EdxPDFEncryptionException exception if the SecurityOptions.Algorithm property is set to eatAES and the SecurityOptions.Enabled property is set to True. Unlike SaveToStream, the LoadFromStream procedure can load documents encrypted with the AES algorithm.

See Also