TraceGraphicsStatePairs

Content stream editing

Description

Captures matching graphics-state snapshots immediately before and after every instruction in a TPDFContentProgram while replaying the program only once. A supplied tracker is advanced to the final state, allowing the next page content layer to continue the same logical stream

The before snapshot resolves an XObject invocation without applying it, while the after snapshot reports text advances and state changes produced by the instruction. Passing nil uses a temporary tracker

Syntax

Delphi

Function TPDFContentProgram.TraceGraphicsStatePairs(Tracker: TPDFContentStateTracker; Out BeforeStates, AfterStates: TPDFContentGraphicsStateArray): Integer;

Return values

0 or greaterNumber of instructions and therefore the length of each returned state array

Ownership

The returned dynamic arrays are caller-managed values. The method does not take ownership of a supplied tracker