API referenceGraphics

pdfInitColorManagement

Initialize document-level color-management state — a

C
BOOL32 __stdcall pdfInitColorManagement(PPDF IPDF, PPDFColorProfiles Profiles, TPDFColorSpace DestSpace, TPDFInitCMFlags Flags);
BOOL32 __stdcall pdfInitColorManagementEx(PPDF IPDF, PPDFColorProfilesEx Profiles, TPDFColorSpace DestSpace, TPDFInitCMFlags Flags);
Delphi
function pdfInitColorManagement(const IPDF: PPDF; Profiles: PPDFColorProfiles; DestSpace: TPDFColorSpace; Flags: TPDFInitCMFlags): LongBool; stdcall;
function pdfInitColorManagementEx(const IPDF: PPDF; Profiles: PPDFColorProfilesEx; DestSpace: TPDFColorSpace; Flags: TPDFInitCMFlags): LongBool; stdcall;

Purpose. Initialize document-level color-management state — a destination color space, policy flags, and (Ex) a device ICC profile.

Description. Verified pure no-op beyond storing its own arguments. pdfInitColorManagement ignores Profiles entirely (never dereferenced) and calls through to InitColorManagement(DestSpace, Flags, nil), which sets FCMInitialized := True, FCMDestSpace := DestSpace, FCMFlags := Flags, and stores an (empty, since nil was passed) device-profile byte array. pdfInitColorManagementEx additionally copies Profiles^.DeviceProfile bytes (if present) into that stored array. None of FCMInitialized, FCMDestSpace, FCMFlags, or FCMDeviceProfile is ever read anywhere else in the codebase — none of the four fields is read anywhere in the engine. Image rendering, color conversion (pdfConvColor/pdfConvertColors above), and document output are entirely unaffected by having called this function; color management is not actually wired into any rendering or output path.

Parameters.

ParameterDescription
IPDFDocument handle.
Profiles*(Ex only — plain form ignores this entirely)* Device ICC profile bytes; stored but never consulted.
DestSpaceDestination color space; stored but never consulted.
FlagsInit flags; stored but never consulted.

Return value. True if IPDF is a valid document handle; False otherwise. The return value reflects only handle validity, not that any color-management behavior was actually enabled.

See also. pdfConvColor (the only place real ICC color math happens, and it does so independently of these two calls).

C# (P/Invoke)

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

Core

Exported names

pdfInitColorManagement

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.