API referenceGraphics

pdfClipPath

Set the clipping path to the current path (W/W*), then

CategoryClipping
NoteFillMode here uses a DIFFERENT, incompatible mapping from the chapter's shared table (see Remarks)

Purpose — Set the clipping path to the current path (W/W*), then optionally also paint it.

Declarations

C
BOOL32 __stdcall pdfClipPath(PPDF IPDF, TClippingMode ClipMode, TPathFillMode FillMode);
Delphi
function pdfClipPath(const IPDF: PPDF; ClipMode: TClippingMode; FillMode: TPathFillMode): LongBool; stdcall; external 'LumasPdf.dll';

TClippingMode:

Delphi
TClippingMode = (cmEvenOdd, cmWinding);

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
ClipModeTClippingModecmEvenOdd (0) emits W*; cmWinding (1) emits W.
FillModeTPathFillModeNot the chapter's shared 12-value table — see Remarks for this call's own, smaller mapping.

Return valueTRUE on success; FALSE if no content stream is open.

Remarks — verified: FillMode means something different here than everywhere else in this chapter. pdfClipPath implements its own reduced dispatch, not WriteFillMode's 12-value table:

FillMode value(s)Emitted paint opMeaning
0, 3, 6fFill
1, 4SStroke
2, 5BFill+stroke
anything else (711, or out of range)nClip only, no paint

Critically, this call never emits an explicit h (close) operator regardless of FillMode — the "close" distinction that matters for the chapter's shared table (e.g. 3 = close+fill vs 0 = fill-no-close) is not preserved here; both 0 and 3 produce plain f. If you're reusing a FillMode constant you also pass to pdfRectangle/pdfClosePath/etc., verify against this table — passing the same integer to pdfClipPath does not necessarily do what its meaning elsewhere would suggest (though for the common values 0/1/2/3/4/5 the *paint operator chosen* happens to agree even though the close behavior differs; values 611 diverge outright — e.g. 6 means "fill even-odd" in the shared table but produces a plain nonzero-winding f here, and the shared table's n/h distinction at 10/11 both collapse to n here).

See alsopdfBeginClipPath

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Graphics
Category

Core

Exported names

pdfClipPath

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.