API referenceGraphics

pdfGetColorSpace

Return the current fill color space.

C
int32_t __stdcall pdfGetColorSpace(PPDF IPDF);
Delphi
function pdfGetColorSpace(const IPDF: PPDF): Integer; stdcall;

Purpose. Return the current fill color space.

Description. Returns FFillCS (GetFillCSVal) — the device ordinal or registered handle last applied to the fill side by pdfSetColorSpace or pdfSetFillColorSpace. There is no corresponding stroke-side getter in the ABIFStrokeCS can be written (via pdfSetColorSpace or pdfSetStrokeColorSpace) but never read back through a dedicated export. A caller that needs to track the stroke color space must maintain its own shadow copy of whatever value it last set.

Parameters.

ParameterDescription
IPDFDocument handle.

Return value. The current fill color space (device ordinal or registered handle); 0 if IPDF is invalid.

See also. pdfSetColorSpace.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfGetColorSpace(IntPtr IPDF);
Area
Graphics
Category

Getters

Exported names

pdfGetColorSpace

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.