EnumPageContentStatesEx
Page manipulation
Description
Traces selected-page instructions and optionally descends into Form XObject content using the graphics state and resource scope active at each Do operator
Syntax
Delphi
Function EnumPageContentStatesEx(AfterInstruction: Boolean; MaxFormDepth: Integer; Var States: Array Of TPDFlibContentGraphicsState): Integer;Parameters
AfterInstruction selects snapshots immediately after each operator when true and immediately before each operator when false
MaxFormDepth
States
Return value
States
Remarks
Call once with an empty array to obtain the count, allocate the destination, then call again to fill itPage
Form execution follows graphics-state isolation, form-matrix concatenation, /BBox clipping and current-resource selection
UseBlackPtComp selects the number of nested Form levels to execute, where zero retains page-level instructions only and values above 64 are limited to 64Do receives as many records as fit in the caller-supplied array
Return value. The total snapshot count, including records that do not fit in /Resources, or zero when no document is selected or a page content layer cannot be parsed
Repeated Form streams are decoded and parsed once per enumeration, then executed independently for each invocation
Active-path cycle detection and the depth limit prevent unbounded recursion without suppressing valid reuse from separate invocation branches
When AfterInstruction is true, nested snapshots precede their containing Do snapshot because the operator completes after its descendants; before snapshots use the opposite pre-order
FormTraversalStatus and FormDescendantCount report whether each Form was enumerated or skipped, while invocation and parent fields reconstruct the call tree