GemBox.Pdf
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PdfColorSpace Class

    Namespace:
    GemBox.Pdf.Content.Colors
    Assembly:
    GemBox.Pdf.dll

    Represents a color system of a PDF content.

    • C#
    • VB.NET
    public abstract class PdfColorSpace : PdfContentResource
    Public MustInherit Class PdfColorSpace
        Inherits PdfContentResource
    Inheritance:
    Object
    PdfObject
    PdfContentResource
    PdfColorSpace

    Properties

    ColorantCount

    Gets the number of color components in the color space.

    • C#
    • VB.NET
    public abstract int ColorantCount { get; }
    Public MustOverride ReadOnly Property ColorantCount As Integer
    Property Value
    Int32

    The number of color components in the color space.

    DeviceCMYK

    Gets the single instance of the DeviceCMYK color space.

    • C#
    • VB.NET
    public static PdfColorSpace DeviceCMYK { get; }
    Public Shared ReadOnly Property DeviceCMYK As PdfColorSpace
    Property Value
    PdfColorSpace

    The single instance of the DeviceCMYK color space.

    See Also
    PDF Specification ISO 32000-1:2008, section '8.6.4.4 DeviceCMYK Color Space'

    DeviceGray

    Gets the single instance of the DeviceGray color space.

    • C#
    • VB.NET
    public static PdfColorSpace DeviceGray { get; }
    Public Shared ReadOnly Property DeviceGray As PdfColorSpace
    Property Value
    PdfColorSpace

    The single instance of the DeviceGray color space.

    See Also
    PDF Specification ISO 32000-1:2008, section '8.6.4.2 DeviceGray Color Space'

    DeviceRGB

    Gets the single instance of the DeviceRGB color space.

    • C#
    • VB.NET
    public static PdfColorSpace DeviceRGB { get; }
    Public Shared ReadOnly Property DeviceRGB As PdfColorSpace
    Property Value
    PdfColorSpace

    The single instance of the DeviceRGB color space.

    See Also
    PDF Specification ISO 32000-1:2008, section '8.6.4.3 DeviceRGB Color Space'

    Family

    Gets the type of the color space.

    • C#
    • VB.NET
    public abstract PdfColorSpaceFamily Family { get; }
    Public MustOverride ReadOnly Property Family As PdfColorSpaceFamily
    Property Value
    PdfColorSpaceFamily

    The type of the color space.

    Pattern

    Gets the single instance of the Pattern color space used with colored tiling patterns.

    • C#
    • VB.NET
    public static PdfColorSpace Pattern { get; }
    Public Shared ReadOnly Property Pattern As PdfColorSpace
    Property Value
    PdfColorSpace

    The single instance of the Pattern color space used with colored tiling patterns.

    See Also
    PDF Specification ISO 32000-1:2008, section '8.6.6.2 Pattern Color Spaces'

    Methods

    Equals(Object)

    Determines whether the specified Object is equal to this PdfColorSpace instance.

    • C#
    • VB.NET
    public sealed override bool Equals(object obj)
    Public NotOverridable Overrides Function Equals(obj As Object) As Boolean
    Parameters
    obj
    Object

    The Object to compare with this color space instance.

    Returns
    Boolean

    true if the specified Object is equal to this PdfColorSpace instance; otherwise, false.

    Overrides
    Object.Equals(Object)

    FromArray(PdfArray)

    Gets or creates a PdfColorSpace from the specified PdfArray whose first element is a PdfName object identifying the color space family. The remaining PdfArray elements, if any, are parameters that further characterize the color space; their number and types vary according to the particular PdfColorSpaceFamily.

    • C#
    • VB.NET
    public static PdfColorSpace FromArray(PdfArray array)
    Public Shared Function FromArray(array As PdfArray) As PdfColorSpace
    Parameters
    array
    PdfArray

    A PdfArray whose first element is a PdfName object identifying the color space family. The remaining PdfArray elements, if any, are parameters that further characterize the color space; their number and types vary according to the particular PdfColorSpaceFamily.

    Returns
    PdfColorSpace

    An instance of a PdfColorSpace or null.

    Remarks

    If PdfColorSpace was already created from the same array, that PdfColorSpace instance is returned.

    This method provides a way to create PdfColorSpaces that are currently not available in GemBox.Pdf (such as CalGray, CalRGB, Lab, ICCBased, Indexed, Separation, and DeviceN).

    PdfColorSpaces available in GemBox.Pdf are accessible via DeviceGray, DeviceRGB, DeviceCMYK, and Pattern properties.

    Exceptions
    ArgumentNullException

    array is null.

    GetHashCode()

    Returns a hash code for this PdfColorSpace instance.

    • C#
    • VB.NET
    public sealed override int GetHashCode()
    Public NotOverridable Overrides Function GetHashCode As Integer
    Returns
    Int32

    An integer value that specifies a hash value for this PdfColorSpace instance.

    Overrides
    Object.GetHashCode()

    ToString()

    Returns a String that represents this PdfColorSpace instance.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    String

    A String that represents this PdfColorSpace instance.

    Overrides
    Object.ToString()
    Remarks

    This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).

    Inherited Properties

    Document

    Gets the PdfDocument associated with this PdfContentResource or null if no PdfDocument is associated with this PdfContentResource.

    (Inherited from PdfContentResource)

    Metadata

    (Optional; PDF 1.4) A metadata stream containing metadata for the component.

    (Inherited from PdfObject)

    Extension Methods

    PdfObjectExtensions.GetDictionary(PdfObject)
    PdfObjectExtensions.GetOrAddDictionary(PdfObject)
    PdfObjectExtensions.GetArray(PdfObject)

    Examples

    Colors example

    See Also

    PDF Specification ISO 32000-1:2008, section '8.6 Color Spaces'
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.