TPDFContentClipSegmentArray

Data types, content stream editing

Description

TPDFContentClipSegmentArray is a dynamic array of TPDFContentClipSegment records describing a path in page space. Each record holds a Kind of TPDFContentClipSegmentKind (cskMoveTo, cskLineTo, cskCurveTo, cskClosePath) and the coordinates X1, Y1, X2, Y2, X3, Y3.

A cskMoveTo segment uses only X3/Y3, the new current point. cskLineTo stores its end point in X3/Y3, cskCurveTo stores both control points in X1/Y1 and X2/Y2 plus the end point in X3/Y3, and cskClosePath stores the subpath start in X3/Y3.

The array appears as TPDFContentGraphicsState.PaintedPathSegments, which a before-execution snapshot fills at a path-painting instruction, and as TPDFContentClipPath.Segments, which describes one component of a tracked clipping path. TPDFContentStateTracker.SnapshotPathSegments returns the current path in the same form.

Syntax

Delphi

TPDFContentClipSegmentArray = Array Of TPDFContentClipSegment;

Remarks

Coordinates are mapped through the CTM that is in force when the construction operator executes, so segments are already in default user space and not in the coordinates written in the stream.

The v and y curve operators are normalised to cskCurveTo, with the missing control point filled from the current point or from the end point.

Consecutive m operators collapse: a move that directly follows another move overwrites the previous segment's X3/Y3 instead of appending a new segment.

Painting and clipping operators add no segments; re expands to a move, three lines and a close.

The array is a capture of geometry as tracked, not an editable model: to change a path, lift it with LiftPath, edit the subpaths and write it back with LowerPath.

See also

TraceGraphicsStates, TraceGraphicsStatePairs, TPDFContentGraphicsStateArray, GetPageElementClipPathSegmentKind, GetPageElementClipPathSegmentCoordinate, TPDFContentStateTracker, TPDFPath