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

    Show / Hide Table of Contents

    PdfNumber Class

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

    Represents a PDF numeric object.

    • C#
    • VB.NET
    public abstract class PdfNumber : PdfBasicValue
    Public MustInherit Class PdfNumber
        Inherits PdfBasicValue
    Inheritance:
    System.Object
    PdfBasicObject
    PdfBasicValue
    PdfNumber
    Derived
    PdfInteger

    Properties

    IsInteger

    Gets a value indicating whether this PdfNumber instance is PdfInteger.

    • C#
    • VB.NET
    public abstract bool IsInteger { get; }
    Public MustOverride ReadOnly Property IsInteger As Boolean
    Property Value
    System.Boolean

    true if this PdfNumber instance is PdfInteger; otherwise, false.

    ObjectType

    Gets the Number value.

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

    The Number value.

    Overrides
    PdfBasicObject.ObjectType

    Value

    Gets a System.Double value of this PdfNumber instance.

    • C#
    • VB.NET
    public double Value { get; }
    Public ReadOnly Property Value As Double
    Property Value
    System.Double

    A System.Double value of this PdfNumber instance.

    Methods

    Create(Double)

    Creates the PdfNumber instance from the specified System.Double value rounded to 15 digits of precision.

    • C#
    • VB.NET
    public static PdfNumber Create(double value)
    Public Shared Function Create(value As Double) As PdfNumber
    Parameters
    value
    System.Double

    The number value.

    Returns
    PdfNumber

    A PdfNumber instance created from the specified System.Double 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.ArgumentException

    Value is either System.Double.NaN, System.Double.NegativeInfinity or System.Double.PositiveInfinity.

    See Also
    GemBox.Pdf.Objects.IPdfAttachedObject

    Inherited Properties

    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 PdfBasicValue instance.

    (Inherited from PdfBasicValue)

    GetHashCode()

    Returns a hash code for this PdfBasicValue instance.

    (Inherited from PdfBasicValue)

    ToString()

    Returns a System.String that represents this PdfBasicObject instance.

    (Inherited from PdfBasicObject)

    See Also

    PDF Specification ISO 32000-1:2008, section '7.3.3 Numeric Objects'
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.