API referenceGraphics

pdfGetColorSpaceCount

Return the number of color spaces registered on the document

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

Purpose. Return the number of color spaces registered on the document (via any of the color-space-creation APIs — ICCBased, CIE, DeviceN, Indexed, Separation).

Description. Returns ColorSpaceRegCount — the live registration count tracked internally as color spaces are created. This counts registration slots, not necessarily still-usable spaces: a color space marked deleted (CSDeleted) by whatever removal path exists for it still occupies a slot and is included in the count.

Parameters.

ParameterDescription
IPDFDocument handle.

Return value. The number of registered color-space slots; 0 if IPDF is invalid or none have been created.

See also. pdfGetColorSpaceObj.

C# (P/Invoke)

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

Getters

Exported names

pdfGetColorSpaceCount

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.