SetPackObjectStreams
Document properties, Optimisation
Description
Enables or disables object-stream packing on save operations, which requires PDF 1.5 or higher.
Syntax
Delphi
Function TPDFlib.SetPackObjectStreams(Enable: Integer): Integer;ActiveX
Function PDFlib::SetPackObjectStreams(Enable As Long) As LongDLL
int DLSetPackObjectStreams(int InstanceID, int Enable);Parameters
| Enable | Pass 1 to enable object stream packing (default), or 0 to disable it. |
|---|
Return values
| 0 | Failed to apply setting (no active document). |
|---|---|
| 1 | Setting applied successfully. |
Remarks
Packing objects into cross-reference streams and object streams significantly reduces file overhead. Full saves materialise imported compact members, remove obsolete structural streams, and rebuild packing from the live object graph. It is only applied if the target PDF version is set to PDF 1.5 or newer.
Example
PDF.SetPDFVersion(5); // Set PDF 1.5
PDF.SetPackObjectStreams(1);
PDF.SaveToFile('packed.pdf');