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;

Parameters

EnablePass 1 to enable object stream packing (default), or 0 to disable it.

Return values

0Failed to apply setting (no active document).
1Setting 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');

See also

GetPackObjectStreams, GetLastSaveUsedObjectStreams