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

    Show / Hide Table of Contents

    PdfIndirectObject Class

    Namespace:
    GemBox.Pdf.Objects
    Assembly:
    GemBox.Pdf.dll

    Represents an indirect basic PDF object that other PdfBasicObjects can refer to (for example, as an element of an PdfArray or as the value of a PdfDictionary entry).

    • C#
    • VB.NET
    public sealed class PdfIndirectObject : PdfBasicContainer
    Public NotInheritable Class PdfIndirectObject
        Inherits PdfBasicContainer
    Inheritance:
    System.Object
    PdfBasicObject
    PdfBasicContainer
    PdfIndirectObject

    Properties

    Id

    Gets the identifier of the current PdfIndirectObject.

    • C#
    • VB.NET
    public PdfIndirectObjectIdentifier Id { get; }
    Public ReadOnly Property Id As PdfIndirectObjectIdentifier
    Property Value
    PdfIndirectObjectIdentifier

    The identifier of the current PdfIndirectObject.

    ObjectType

    Gets the IndirectObject value.

    • C#
    • VB.NET
    public override PdfBasicObjectType ObjectType { get; }
    Public Overrides ReadOnly Property ObjectType As PdfBasicObjectType
    Property Value
    PdfBasicObjectType

    The IndirectObject value.

    Overrides
    PdfBasicObject.ObjectType

    Value

    Gets or sets the value of this PdfIndirectObject.

    caution

    Set a value only if you are sure that this PdfIndirectObject is not referenced from any other place.

    GemBox.Pdf never sets a value of an existing PdfIndirectObject because the PdfIndirectObject might be referenced from several places, instead new PdfIndirectObject is created and its value is set.

    • C#
    • VB.NET
    public PdfBasicObject Value { get; set; }
    Public Property Value As PdfBasicObject
    Property Value
    PdfBasicObject

    The value of this PdfIndirectObject.

    Exceptions
    System.InvalidOperationException

    The current PdfIndirectObject is read-only (IsReadOnly returns true).

    System.ArgumentNullException

    value is null.

    System.ArgumentException

    value is already contained in some other PdfBasicObject or is PdfIndirectObject.

    Methods

    Clone(Boolean)

    Makes a deep clone of the PdfIndirectObject with optionally cloning descendant PdfIndirectObjects.

    • C#
    • VB.NET
    public PdfIndirectObject Clone(bool shallowIndirect)
    Public Function Clone(shallowIndirect As Boolean) As PdfIndirectObject
    Parameters
    shallowIndirect
    System.Boolean

    if set to true descendant PdfIndirectObjects won't be cloned.

    Returns
    PdfIndirectObject

    A deep clone of the PdfIndirectObject.

    Clone(Func<PdfIndirectObject, PdfBasicObject>)

    Makes a deep clone of the PdfIndirectObject with parameter that controls the cloning of PdfIndirectObjects.

    • C#
    • VB.NET
    public PdfIndirectObject Clone(Func<PdfIndirectObject, PdfBasicObject> indirectObjectClone)
    Public Function Clone(indirectObjectClone As Func(Of PdfIndirectObject, PdfBasicObject)) As PdfIndirectObject
    Parameters
    indirectObjectClone
    System.Func<PdfIndirectObject, PdfBasicObject>

    A parameter that controls the cloning of PdfIndirectObjects.

    Returns
    PdfIndirectObject

    A deep clone of the PdfIndirectObject.

    Create()

    Creates a new instance of the PdfIndirectObject class.

    • C#
    • VB.NET
    public static PdfIndirectObject Create()
    Public Shared Function Create As PdfIndirectObject
    Returns
    PdfIndirectObject

    A new instance of the PdfIndirectObject class.

    Remarks

    GemBox.Pdf assembly doesn't publicly expose constructors for types assignable from PdfObject (except PdfDocument), PdfContentElement, and PdfBasicObject types. These types are instead instantiated either through static Create or other factory methods.

    Reasons for this is to support either the current or future extensibility of the type without affecting backward compatibility and without using composition to reduce the number of object allocations.

    For example, PdfNumber type is implemented as PdfInteger and internal PdfReal type. When using Create(Double) method, GemBox.Pdf assembly is able to create either PdfReal or PdfInteger, or return a cached instance of PdfInteger available for an implementation-defined interval of integers, thus reducing memory overhead.

    PdfString and PdfName types have several internal implementations that reduce the number of System.Array allocations.

    PdfArray type is currently implemented as a dynamic array. In the future, GemBox.Pdf assembly might provide an internal implementation that is immutable (without a need to use composition) to reduce memory overhead and optimize cloning operation.

    PdfDictionary type is currently implemented as a hash table with a separate chaining collision resolution. In the future, GemBox.Pdf assembly might provide an internal implementation that uses dynamic array (without a need to use composition) if number of entries is small, to reduce memory overhead and, potentially, improve performance.

    All these current and future implementations would not be possible in a backward compatible way (without unnecessary usage of composition) if constructors were publicly exposed.

    See Also
    GemBox.Pdf.Objects.IPdfAttachedObject

    Create(PdfBasicObject)

    Creates a new instance of the PdfIndirectObject class with the specified value.

    • C#
    • VB.NET
    public static PdfIndirectObject Create(PdfBasicObject value)
    Public Shared Function Create(value As PdfBasicObject) As PdfIndirectObject
    Parameters
    value
    PdfBasicObject

    A value that will be contained in the returned PdfIndirectObject.

    Returns
    PdfIndirectObject

    A new instance of the PdfIndirectObject class with the specified value.

    Remarks

    GemBox.Pdf assembly doesn't publicly expose constructors for types assignable from PdfObject (except PdfDocument), PdfContentElement, and PdfBasicObject types. These types are instead instantiated either through static Create or other factory methods.

    Reasons for this is to support either the current or future extensibility of the type without affecting backward compatibility and without using composition to reduce the number of object allocations.

    For example, PdfNumber type is implemented as PdfInteger and internal PdfReal type. When using Create(Double) method, GemBox.Pdf assembly is able to create either PdfReal or PdfInteger, or return a cached instance of PdfInteger available for an implementation-defined interval of integers, thus reducing memory overhead.

    PdfString and PdfName types have several internal implementations that reduce the number of System.Array allocations.

    PdfArray type is currently implemented as a dynamic array. In the future, GemBox.Pdf assembly might provide an internal implementation that is immutable (without a need to use composition) to reduce memory overhead and optimize cloning operation.

    PdfDictionary type is currently implemented as a hash table with a separate chaining collision resolution. In the future, GemBox.Pdf assembly might provide an internal implementation that uses dynamic array (without a need to use composition) if number of entries is small, to reduce memory overhead and, potentially, improve performance.

    All these current and future implementations would not be possible in a backward compatible way (without unnecessary usage of composition) if constructors were publicly exposed.

    Exceptions
    System.ArgumentNullException

    value is null.

    System.ArgumentException

    value is already contained in some other PdfBasicObject or is PdfIndirectObject.

    See Also
    GemBox.Pdf.Objects.IPdfAttachedObject

    ToString()

    Returns a System.String that represents this PdfIndirectObject instance.

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

    A System.String that represents this PdfIndirectObject instance.

    Overrides
    PdfBasicObject.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

    Indirect

    Gets the PdfIndirectObject if this PdfBasicContainer is Value or null otherwise.

    (Inherited from PdfBasicContainer)

    IsReadOnly

    Gets a value indicating whether the PdfBasicContainer and all of its descendants are read-only.

    (Inherited from PdfBasicContainer)

    Null

    Gets the single instance of Null type.

    (Inherited from PdfBasicObject)

    Inherited Methods

    Equals(System.Object)

    Determines whether the specified System.Object is equal to this PdfBasicContainer instance.

    (Inherited from PdfBasicContainer)

    GetHashCode()

    Returns a hash code for this PdfBasicContainer instance.

    (Inherited from PdfBasicContainer)

    Examples

    Basic Objects example

    See Also

    PDF Specification ISO 32000-1:2008, section '7.3.10 Indirect Objects'
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.