| Category | Clipping |
|---|---|
| Note | FillMode 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
BOOL32 __stdcall pdfClipPath(PPDF IPDF, TClippingMode ClipMode, TPathFillMode FillMode);
function pdfClipPath(const IPDF: PPDF; ClipMode: TClippingMode; FillMode: TPathFillMode): LongBool; stdcall; external 'LumasPdf.dll';
TClippingMode:
TClippingMode = (cmEvenOdd, cmWinding);
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
ClipMode | TClippingMode | cmEvenOdd (0) emits W*; cmWinding (1) emits W. |
FillMode | TPathFillMode | Not the chapter's shared 12-value table — see Remarks for this call's own, smaller mapping. |
Return value — TRUE 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 op | Meaning |
|---|---|---|
0, 3, 6 | f | Fill |
1, 4 | S | Stroke |
2, 5 | B | Fill+stroke |
anything else (7–11, or out of range) | n | Clip 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 6–11 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 also — pdfBeginClipPath
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Core
pdfClipPath
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.