function SaveAs(Stream: TStream; Option: TSaveOption = saNone; PdfVersion: TPdfVersion = pvUnknown): Boolean;
| Stream | TStream. A TStream to write the PDF data into. |
| Option | TSaveOption. Save option: soNone for a full rewrite, or soIncremental for an incremental update appended to the file. |
| PdfVersion | TPdfVersion. Target PDF version. Use pvUnknown to preserve the current version. |
function SaveAs(const FileName: string; Option: TSaveOption = saNone; PdfVersion: TPdfVersion = pvUnknown): Boolean;
| FileName | string. The output file path. The file is created or overwritten. |
| Option | TSaveOption. Save option: soNone for a full rewrite, or soIncremental for an incremental update appended to the file. |
| PdfVersion | TPdfVersion. Target PDF version. Use pvUnknown to preserve the current version. |
True if the document was saved successfully, or False on failure.Saves the current document to a file path or a TStream. The
Option parameter controls the save mode: soNone performs
a complete file rewrite, while soIncremental appends only the changes
made since the document was last saved (smaller output, but grows over repeated
saves).
The PdfVersion parameter specifies the output PDF version;
pass pvUnknown to keep the document's existing version.
The Compressed property controls whether object-stream compression
is applied during the save.
// Save to file
Pdf.SaveAs('output.pdf');
// Save to stream
var MS: TMemoryStream;
MS := TMemoryStream.Create;
try
Pdf.SaveAs(MS);
MS.SaveToFile('output.pdf');
finally
MS.Free;
end;