DynaPDF.InitColorManagementEx
-----------------------------

Initializes color management.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [6.0](newinversion60.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.InitColorManagementEx"; PDF { ; DestSpace; Flags; DefInGray; DefInRGB; DefInCMYK; DeviceProfile; SoftProof } ) 

**MBS**( **"DynaPDF.InitColorManagementEx";** /\* Initializes color management. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$DestSpace**; /\* Optional; Destination color space. Can be DeviceRGB, DeviceCMYK or DeviceGray. Default is DeviceRGB.e.g. "DeviceRGB" \*/   
**$Flags**; /\* Optional; Flags for color management initialization. Can be Default or a combination of BPCompensation (1), CheckBlackPoint (2) or both (3).e.g. "BPCompensation" \*/   
**$DefInGray**; /\* Optional; The gray profile as Container.  
You can pass empty text/value if you have no gray profile.e.g. MyTable::gDefInGray \*/   
**$DefInRGB**; /\* Optional; The RGB profile as container.  
You can pass empty text/value if you have no RGB profile.e.g. MyTable::gDefInRGB \*/   
**$DefInCMYK**; /\* Optional; The CMYK profile as container.  
You can pass empty text/value if you have no CMYK profile.e.g. MyTable::gDefInCMYK \*/   
**$DeviceProfile**; /\* Optional; The Device profile as container, must be compatible with the output color space. Default is sRGB.  
You can pass empty text/value if you have no device profile.e.g. MyTable::gDeviceProfile \*/   
**$SoftProof**) /\* Optional; The output profile as conainer for emulating output device.  
You can pass empty text/value if you have no soft proof profile.e.g. MyTable::gSoftProof \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |  |
| DestSpace | Destination color space. Can be DeviceRGB, DeviceCMYK or DeviceGray. Default is DeviceRGB. | "DeviceRGB" | Optional |
| Flags | Flags for color management initialization. Can be Default or a combination of BPCompensation (1), CheckBlackPoint (2) or both (3). | "BPCompensation" | Optional |
| DefInGray | The gray profile as Container.   You can pass empty text/value if you have no gray profile. | MyTable::gDefInGray | Optional |
| DefInRGB | The RGB profile as container.   You can pass empty text/value if you have no RGB profile. | MyTable::gDefInRGB | Optional |
| DefInCMYK | The CMYK profile as container.   You can pass empty text/value if you have no CMYK profile. | MyTable::gDefInCMYK | Optional |
| DeviceProfile | The Device profile as container, must be compatible with the output color space. Default is sRGB.   You can pass empty text/value if you have no device profile. | MyTable::gDeviceProfile | Optional |
| SoftProof | The output profile as conainer for emulating output device.   You can pass empty text/value if you have no soft proof profile. | MyTable::gSoftProof | Optional |

### Result

Returns OK or error.

### Description

Initializes color management.  
Enables color management the functions [DynaPDF.RenderPage](DynaPDFRenderPage.md), [DynaPDF.RenderPDFFile](DynaPDFRenderPDFFile.md) exactly like [DynaPDF.InitColorManagement](DynaPDFInitColorManagement.md) but accepts ICC profile as containers instead of file paths. See [DynaPDF.InitColorManagement](DynaPDFInitColorManagement.md) for further information.   
  
Initializing the color management requires a considerable amount of processing time. It is strongly recommended to use one PDF instance as long as possible so that it must not be initialized again when another PDF file will be rendered.   
The color management can be initialized right after the PDF instance was created.   
See also [InitColorManagementEx](https://www.monkeybreadsoftware.com/DynaPDF-Manual/InitColorManagementEx.shtml) function in DynaPDF manual.

### Examples

Initialize with profiles in containers:

 Set Variable \[ $r ; Value: MBS ("DynaPDF.InitColorManagementEx"; $pdf ; "DeviceRGB"; "BPCompensation"; Settings::Gray ICC Profile; Settings::RGB ICC Profile; Settings::CMYK ICC Profile) \]  
### See also

- [DynaPDF.InitColorManagement](DynaPDFInitColorManagement.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.RenderPage](DynaPDFRenderPage.md)
- [DynaPDF.RenderPDFFile](DynaPDFRenderPDFFile.md)
- [DynaPDF.RenderPDFFileEx](DynaPDFRenderPDFFileEx.md)

### Release notes

- **Version 16.1**
    - Changed [DynaPDF.InitColorManagement](https://www.mbsplugins.eu/DynaPDFInitColorManagement.shtml) and [DynaPDF.InitColorManagementEx](https://www.mbsplugins.eu/DynaPDFInitColorManagementEx.shtml), so you can call without profiles to deactivate color management.

### Example Databases

- [DynaPDF/Optimize PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Optimize%20PDF.shtml#2ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 16.1pr1](https://www.mbsplugins.de/archive/2026-02-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 27th January 2016 , last changed 27th May 2021

  
[DynaPDF.InitColorManagement](DynaPDFInitColorManagement.md) - [DynaPDF.Initialize](DynaPDFInitialize.md)

[HTML Version](DynaPDFInitColorManagementEx.shtml)