SetStreamDecodeLimits

Document loading, security, performance

Description

Sets the maximum stream filter-chain length and cumulative decoded bytes for one tracked operation

Syntax

Delphi

Function TPDFlib.SetStreamDecodeLimits(MaxFilters: Integer; MaxOperationBytes: Int64): Integer;

Parameters

MaxFiltersThe maximum filters in one stream chain, or 0 for no filter-count limit
MaxOperationBytesThe maximum decoded bytes accumulated across streams in one tracked operation, or 0 for no cumulative limit

Return values

1The limits were accepted
0Either limit was negative

Remarks

The filter count is checked before decoder allocation and the byte budget prevents many individually small streams from bypassing a single-stream limit

Tracked load, save, extraction, search and optimisation operations start with a fresh cumulative byte counter