Apitron.PDF.Kit library for .NET
Assembly: Apitron.PDF.Kit (in Apitron.PDF.Kit.dll) Version: 2.0.37.0 (2.0.37.0)
Initializes a new instance of the ICCBasedColorSpace class.
Namespace: Apitron.PDF.Kit.FixedLayout.Resources.ColorSpaces.CIEBased
Assembly: Apitron.PDF.Kit (in Apitron.PDF.Kit.dll) Version: 2.0.37.0 (2.0.37.0)
Syntax
public ICCBasedColorSpace( string resourceID, byte[] iccProfileData, string alternateResourceID )
Parameters
- resourceID
- Type: SystemString
The resource ID. - iccProfileData
- Type: SystemByte
The icc profile data. - alternateResourceID
- Type: SystemString
The alternate resource ID is an alternate colour space that shall be used in case the one specified in the stream data is not supported.
Examples
C#
byte[] iccProfileData; // register alternate color space document.ResourceManager.RegisterResource(new CmykColorSpace("CS_CMYK")); // read data from ICC profile using (FileStream iccProfile = new FileStream("YOUR_PROFILE.icm", FileMode.Open, FileAccess.Read)) { iccProfileData = new byte[iccProfile.Length]; using (BinaryReader reader = new BinaryReader(iccProfile)) { reader.Read(iccProfileData, 0, iccProfileData.Length); } } // register ICCBased color space as a resource document.ResourceManager.RegisterResource(new ICCBasedColorSpace("CS_ICCBased", iccProfileData, "CS_CMYK")); // set color space page.Content.SetNonStrokingColorSpace("CS_ICCBased"); page.Content.SetStrokingColorSpace("CS_ICCBased"); // set color page.Content.SetNonStrokingColor(0.0, 0.6, 0.3); page.Content.SetStrokingColor(0.3, 0.6, 0.0);
See Also