ApplyContentFilterChain

Content streams

Description

Runs an instruction-level content filter chain over every content layer of one page

Syntax

Delphi

Function ApplyContentFilterChain(TargetPage: Integer; OpFilter: TPDFContentFilterCallback; FilterData: Pointer = Nil): Integer;

Parameters

TargetPageOne-based page number whose content layers are filtered; the call is rejected when the page lies outside the document
OpFilterInstruction filter callback of type TPDFContentFilterCallback; it receives one decoded content layer per call
FilterDataOpaque pointer forwarded to the callback; Nil is the default

Return values

0The page, the document or the filter callback is invalid, or no layer changed
NNumber of content layers that were parsed, filtered through the chain and written back

Remarks

The callback receives a TPDFContentProgram holding the decoded instruction list of one content layer and may insert, delete or mutate instructions in place. Return cfrContinue to proceed to the next filter and layer, or cfrStop to end the chain early; layers already written stay modified. Use NewContentFilterChain to build multi-filter chains with ApplyContentFilterChainExt.

Example

Count:= PDF.ApplyContentFilterChain(1, MyStrokeifyFilter, nil);

See also

AuditDocumentSpace, AnalyseFile