API referenceGraphics

pdfSetFillColorSpace

Set the current fill (resp. stroke) color space independently

C
void __stdcall pdfSetFillColorSpace(PPDF IPDF, int32_t CS);
void __stdcall pdfSetStrokeColorSpace(PPDF IPDF, int32_t CS);
Delphi
procedure pdfSetFillColorSpace(const IPDF: PPDF; CS: Integer); stdcall;
procedure pdfSetStrokeColorSpace(const IPDF: PPDF; CS: Integer); stdcall;

Purpose. Set the current fill (resp. stroke) color space independently of the other side, without going through pdfSetColorSpace's validation.

Description. Each is a bare one-line assignment — FFillCS := CS (resp. FStrokeCS := CS) — with no validation whatsoever: no negative-value check, no FindCSByHandle existence check, no device-ordinal-range check. Passing an unregistered or deleted handle is accepted silently; the effect only becomes visible later, when a fill/stroke color-set call attempts to resolve FFillCS/FStrokeCS against the (missing) color-space table entry. This is a real asymmetry against pdfSetColorSpace, which validates the same kind of value before accepting it.

Parameters.

ParameterDescription
IPDFDocument handle.
CSDevice ordinal or registered color-space handle — accepted unconditionally, not validated.

Return value. None (void/procedure) — unlike almost every other setter in this SDK, these two have no BOOL32 success indicator at all.

Remarks. Prefer pdfSetColorSpace when setting fill and stroke to the same space, since it validates its input and reports failure. Use these two only when fill and stroke genuinely need different, independently-tracked color spaces.

See also. pdfSetColorSpace.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern void pdfSetFillColorSpace(IntPtr IPDF, int CS);
Area
Graphics
Category

Setters

Exported names

pdfSetFillColorSpace

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.