ReplacePageElementClipPath

Content stream editing, Clipping paths

Description

Replaces the exact top-level path object that established one editable component of an enumerated element's effective clipping intersection

Syntax

Delphi

Function TPDFlib.ReplacePageElementClipPath(ElementID, ClipPathIndex: Integer; Const PathSource: WideString; FillRule: Integer): Integer;

Parameters

ElementIDOpaque page-element handle
ClipPathIndex1-based component index whose editable flag is returned by property 6 of GetPageElementClipPathInfo
PathSourceReplacement path-construction instructions beginning with m or re
FillRule0 for W or 1 for W*

Return values

1The source path was replaced and all page-element handles were invalidated
0The input is invalid, the captured source changed or the component is read-only

Remarks

The captured source layer, instruction range and normalised fingerprint are all validated before writing

PathSource coordinates use the current user space at the original clipping source; enumerated component geometry uses default user space after the source CTM

If the original terminating operator both painted and clipped the path, replacement changes that painted geometry as well because PDF uses the same current path for both effects

The edit changes every later element that consumes the same graphics-state clipping component, not only the element used to select it

Initial page bounds, text-outline clips, Form-local clips, malformed path objects and paths split across content layers are read-only

LastErrorCode is 532 for invalid input, 533 for stale source or 534 for a read-only component