Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

DynaPDF.InitColorManagement

Enables color management for render functions.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 5.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.InitColorManagement"; PDF { ; DestSpace; Flags; DefInGray; DefInRGB; DefInCMYK; DeviceProfile; SoftProof } )   More

Parameters

Parameter Description Example Flags
PDF The PDF reference returned from DynaPDF.New. $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 Path to gray profile.
You can pass empty text if you have no gray profile.
"/Users/cs/Desktop/Generic Gray Profile.icc" Optional
DefInRGB Path to RGB profile.
You can pass empty text if you have no RGB profile.
"/Users/cs/Desktop/Generic RGB Profile.icc" Optional
DefInCMYK Path to CMYK profile.
You can pass empty text if you have no CMYK profile.
"/Users/cs/Desktop/Generic CMYK Profile.icc" Optional
DeviceProfile Path to Device profile, must be compatible with the output color space. Default is sRGB.
You can pass empty text if you have no device profile.
Optional
SoftProof Path to output profile for emulating output device.
You can pass empty text if you have no soft proof profile.
Optional

Result

Returns OK or error.

Description

Enables color management for render functions.
All color profiles are optional. Default profiles for DeviceGray and DeviceRGB color spaces (sRGB is default) are automatically created if not provided.
The most important color profile is the CMYK profile because it is not possible to create such a profile with build-in functions. If no CMYK profile is set DynaPDF renders CMYK only with color management if the file contains corresponding ICCBased color spaces or an embedded CMYK output intent.
The SoftProof profile specifies an arbitrary output color space that should be simulated.
Although Black Point Compensation (BPC) is not enabled by default, it is recommended to enable it because it improves the rendering quality of CMYK images a lot.
All profile paths must be absolute paths. Otherwise it is maybe not possible to reload a profile if necessary. DynaPDF must be able to reload the profiles if a PDF file contains ICCBased color spaces.
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. If you want to initialize it on demand then make sure that you call the function before OpenImportFile. Otherwise it is possible that certain objects will be rendered without color management.
Returns OK on success.

See also DynaPDF.InitColorManagementEx.

This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.

See also InitColorManagement function in DynaPDF manual.

Examples

Initialize with only a CMYK profile:

MBS("DynaPDF.InitColorManagement"; $pdf; "DeviceCMYK"; 3; ""; ""; "/Users/cs/Desktop/PDF_to_JPEG Test/Generic CMYK Profile.icc")

Initialize for output to CMYK:

MBS("DynaPDF.InitColorManagement"; $pdf; "DeviceCMYK";
3;
"/Users/cs/Desktop/PDF_to_JPEG Test/Generic Gray Profile.icc";
"/Users/cs/Desktop/PDF_to_JPEG Test/Generic RGB Profile.icc";
"/Users/cs/Desktop/PDF_to_JPEG Test/Generic CMYK Profile.icc";
"/Users/cs/Desktop/PDF_to_JPEG Test/Generic CMYK Profile.icc"
)

See also

Blog Entries

This function checks for a license.

Created 17th August 2015, last changed 21st September 2017


DynaPDF.ImportPageAsTemplate - DynaPDF.InitColorManagementEx