API referenceCore SDK

pdfCreateSeparationCS

Register a new Separation color space (a single-colorant

C
int32_t __stdcall pdfCreateSeparationCS(PPDF IPDF, const char* Colorant, int32_t Alternate, int32_t Handle, uint32_t Color);
Delphi
function pdfCreateSeparationCS(const IPDF: PPDF; const Colorant: PAnsiChar; Alternate, Handle: Integer; Color: Cardinal): Integer; stdcall;

Purpose. Register a new Separation color space (a single-colorant spot color with an alternate device-space fallback and reference tint).

Description. Maps Alternate the same coarse way as pdfChangeSeparationColor (Colors and Color Spaces): 1→DeviceCMYK, 2→DeviceGray, anything else→DeviceRGB. Handle is accepted by the ABI but never passed through to CreateSeparationColorSpace — the same dropped- parameter pattern already confirmed for pdfCreateDeviceNColorSpace and pdfCreateIndexedColorSpace (Color-Space Creation and Color Conversion): a fresh handle is always auto-allocated, a caller cannot force a specific handle number.

Parameters.

ParameterDescription
IPDFDocument handle.
ColorantThe spot-colorant name; nil fails.
AlternateDevice alternate space — only CMYK(1)/Gray(2) distinguished, else RGB.
HandleAccepted but ignored — a new handle is always auto-allocated.
ColorReference tint color.

Return value. The new color-space handle; 0 if IPDF is invalid or Colorant is nil.

See also. pdfChangeSeparationColor, pdfRenameSpotColor.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfCreateSeparationCS(IntPtr IPDF, [MarshalAs(UnmanagedType.LPStr)] string Colorant, int Alternate, int Handle, uint Color);
Area
Core SDK
Category

Object Creation

Exported names

pdfCreateSeparationCS

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.