TPDFContentGraphicsStateArray

Data types, content stream editing

Description

TPDFContentGraphicsStateArray is a dynamic array of TPDFContentGraphicsState records, one snapshot per instruction. TraceGraphicsStates returns such an array indexed like the program, so element I describes instruction I and the array length equals the program's Count; TraceGraphicsStatePairs fills a before array and an after array in a single pass.

Each record carries the CTM in force, the instruction index and raw operator name, the resource names resolved for that instruction, clip bounds and clip path components, marked-content frames, the text state (text and line matrices, font resource, size, spacings, rendering mode, rise, writing mode) and the parameters taken from gs dictionaries, among them alpha, blend mode, overprint, halftone, smoothness and transfer function. Fields whose value could not be established are flagged through the matching *Known or *Resolved member.

GetGraphicsState returns one record for a single instruction; the array form exists so a whole layer is evaluated once instead of once per instruction.

Syntax

Delphi

TPDFContentGraphicsStateArray = Array Of TPDFContentGraphicsState;

Remarks

Before-execution arrays carry PaintedPathSegments, a TPDFContentClipSegmentArray, at path-painting instructions, and reset the text advance fields; after-execution arrays leave those members empty.

Passing a TPDFContentStateTracker continues its state and q/Q stack across layers, so consecutive /Contents streams are traced as one sequence; passing Nil starts each call from the ISO page defaults.

The array is a managed dynamic array returned by value and needs no explicit release.

See also

TraceGraphicsStates, TraceGraphicsStatePairs, GetGraphicsState, TPDFContentStateTracker, TPDFContentProgram, TPDFContentClipSegmentArray