SetOptimizeContentStreams

Document properties, Optimisation

Description

Enables or disables the peephole content stream optimizer that runs during CompressContent and CompressPage calls.

Syntax

Delphi

Function TPDFlib.SetOptimizeContentStreams(Enable: Integer): Integer;

ActiveX

Function PDFlib::SetOptimizeContentStreams(Enable As Long) As Long

DLL

int DLSetOptimizeContentStreams(int InstanceID, int Enable);

Parameters

EnablePass 1 to enable optimization (default), or 0 to disable it.

Return values

0Failed to apply setting.
1Setting applied successfully.

Remarks

The content stream optimizer performs redundant operator simplification and spacing reduction. It is enabled by default to ensure minimum file size upon stream compression.

Example

PDF.SetOptimizeContentStreams(1);
PDF.CompressContent; // compress and optimize streams

See also

GetOptimizeContentStreams, CompressContent