API referenceGraphics

pdfChangeSeparationColor

Change the tint-transform color and alternate device space of

C
BOOL32 __stdcall pdfChangeSeparationColor(PPDF IPDF, uint32_t CSHandle, uint32_t NewColor, TExtColorSpace Alternate, int32_t AltHandle);
Delphi
function pdfChangeSeparationColor(const IPDF: PPDF; CSHandle, NewColor: Cardinal; Alternate: TExtColorSpace; AltHandle: Integer): LongBool; stdcall;

Purpose. Change the tint-transform color and alternate device space of an existing Separation color space.

Description. Resolves CSHandle via FindCSByHandle; fails if the handle is unknown or if it does not identify a Separation-kind color space (Kind <> cskSeparation — calling this on an ICC/CIE/DeviceN/Indexed handle fails). On success, updates that Separation entry's SepColor to NewColor and its AltDevCS to the mapped device space for Alternate (1 → DeviceCMYK, 2 → DeviceGray, anything else including 0 → DeviceRGB). The AltHandle parameter accepted by the ABI is never read by the implementation — it is silently dropped; only the coarse Alternate: TExtColorSpace device-space selector has any effect, so a custom ICC/CIE alternate space referenced by handle cannot actually be assigned through this call despite the parameter's presence.

Parameters.

ParameterDescription
IPDFDocument handle.
CSHandleHandle of an existing Separation color space.
NewColorNew tint/reference color value stored on the Separation entry.
AlternateDevice alternate space selector — only esDeviceCMYK(1)/esDeviceGray(2) are distinguished; every other value (including esDeviceRGB) maps to DeviceRGB.
AltHandleAccepted but ignored — has no effect regardless of value.

Return value. True if CSHandle resolved to a Separation space and was updated; False otherwise.

See also. pdfRenameSpotColor.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Graphics
Category

Core

Exported names

pdfChangeSeparationColor

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.