PdfColorSpace Object

Overview

PdfColorSpace represents a color space. This object was introduced in version 2.5. For detailed information about AspPDF's support for various color spaces, see Chapter 16 - Color Spaces of the user manual.

Member List

Properties


Components As Long (Read-only)
Returns the number of color components in this color space (3 for RGB, 4 for CMYK, etc.)

Index As Long (Read-only)

Returns the unique index assigned to this color space object. This value should be passed via the ColorSpace parameter to all methods which expect this parameter such as PdfTable.SetColor, PdfCell.SetColor, PdfCanvas.DrawText and PdfCell.AddText. This property was introduced in Version 2.7.

For more information, see Section 16.4 - Using Color Spaces with PdfTable and Other Objects.


IsValid As Boolean (Read-only)

Returns True if this color space object is valid and complete, or False otherwise. If this property returns False, the verbal error describing the reason for it not being valid should be obtained from the ValidationError property. This property is useful for debugging purposes.

For more information, see Section 16.1.2 - PdfColorSpace Object Usage.


Name As String (Read-only)
Returns the name for this color space, such as "DeviceRGB", "Separaton", etc.

ValidationError As String (Read-only)

Returns the verbal reason for this object not being valid. This property should only be used if IsValid returns False. This property is useful for debugging purposes.

For more information, see Section 16.1.2 - PdfColorSpace Object Usage.

Methods


Sub AddColorant(Name As String, ColorSpace As PdfColorSpace, Func As PdfFunction)

Adds information about an individual colorant for a DeviceN color space. This method can only be called on a DeviceN color space object.

ColorSpace is a separate instance of the PdfColorSpace object representing an alternate color space for this colorant.

Func is an instance of the PdfFunction object representing the transformation function for this colorant.

For more information, see Section 16.1.3 - Supported Color Spaces (DeviceN).


Sub LoadDataFromFile(Path As String)

Loads an ICC profile (.icc file) from a file specified by Path for an ICCBased color space. This method can only be called on a ICCBased color space object.

For more information, see Section 16.1.3 - Supported Color Spaces (ICCBased).


Sub SetAltColorSpace(ColorSpace As PdfColorSpace)

Specifies an alternate color space specified by ColorSpace for an ICCBased color space. This method can only be called on a ICCBased color space object.

For more information, see Section 16.1.3 - Supported Color Spaces (ICCBased).


Sub SetIndexedParams(BaseSpace As PdfColorSpace, Data As Variant)

BaseSpace specifies the base color space in which the values in the color table are to be interpreted. Data specifies the color table itself in the form of a Variant-packed array of numbers.

For more information, see Section 16.1.3 - Supported Color Spaces (Indexed).


Sub SetSeparationParams(Name As String, AltSpace As PdfColorSpace, Func As PdfFunction)

Specifies additional parameters for Separation and DeviceN color spaces. This method can only be called on a Separation or DeviceN color space object.

Name specifies the name of the colorant this Separation color space represents, or a "##"-delimited list of colorants if this object represents a DeviceN color space. AltSpace specifies the alternate color space for this colorant or list of colorants. Func specifies the transformation function for this colorant or list of colorants.

For more information, see Section 16.1.3 - Supported Color Spaces (Separation), Section 16.1.3 - Supported Color Spaces (DeviceN).