pdfInitColorManagement
Initialize document-level color-management state — a
BOOL32 __stdcall pdfInitColorManagement(PPDF IPDF, PPDFColorProfiles Profiles, TPDFColorSpace DestSpace, TPDFInitCMFlags Flags);
BOOL32 __stdcall pdfInitColorManagementEx(PPDF IPDF, PPDFColorProfilesEx Profiles, TPDFColorSpace DestSpace, TPDFInitCMFlags Flags);
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.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Profiles | *(Ex only — plain form ignores this entirely)* Device ICC profile bytes; stored but never consulted. |
DestSpace | Destination color space; stored but never consulted. |
Flags | Init 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)
[return: MarshalAs(UnmanagedType.Bool)]
Core
pdfInitColorManagement
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.