SaveToStream
Document management
Description
Similar to the SaveToFile function, but allows the PDF document to be written to a stream object.
Syntax
Delphi
Function TPDFlib.SaveToStream(OutStream: TStream): Integer;
Parameters
| OutStream | The stream object to write the document to |
|---|
Return values
| 0 | The document could not be saved |
|---|---|
| 1 | The document was saved to the stream successfully |
Remarks
OutStream may be a write-only non-seekable stream such as a network response body because the library tracks PDF offsets internally and emits the completed byte sequence forwards only
Large RC4, AES-CBC, and AES-GCM encrypted streams are transformed directly into OutStream through bounded chunks while their in-memory source bytes remain unchanged, so repeated saves do not require full ciphertext and plaintext restoration copies