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 ColorSpace class.
Namespace: Apitron.PDF.Kit.FixedLayout.Resources.ColorSpaces.Special
Assembly: Apitron.PDF.Kit (in Apitron.PDF.Kit.dll) Version: 2.0.37.0 (2.0.37.0)
Syntax
public IndexedColorSpace( string resourceID, byte[] lookupTable, string baseColorSpaceResourceID )
Parameters
- resourceID
- Type: SystemString
The id. - lookupTable
- Type: SystemByte
The color table. The colour table data shall be m * (hival + 1) bytes long, where m is the number of colour components in the base colour space. Each byte shall be an unsigned integer in the range 0 to 255 that shall be scaled to the range of the corresponding colour component in the base colour space; that is, 0 corresponds to the minimum value in the range for that component, and 255 corresponds to the maximum. - baseColorSpaceResourceID
- Type: SystemString
The base color space resource ID.
Examples
C#
// register base color space as a resource document.ResourceManager.RegisterResource(new GrayColorSpace("CS_Gray")); // register indexed color space (m = 2 for the base i.e. Gray color space) document.ResourceManager.RegisterResource(new IndexedColorSpace("CS_IND", new byte[] { 0, (byte)(0.11 * 255), (byte)(0.25 * 255), (byte)(0.85 * 255), ... }, "CS_Gray")); // set color space page.Content.SetNonStrokingColorSpace("CS_IND"); page.Content.SetStrokingColorSpace("CS_IND"); // set color page.Content.SetNonStrokingColor(0); page.Content.SetStrokingColor(2);
See Also