PdfNumber class
Namespace: PdfNetStack.Objects
Assembly: PdfNetStack.dll
Package: PdfNetStack
A PDF integer or real. The value is kept as canonical ASCII text so that reals read from a file survive a round trip exactly, with no floating point conversion involved.
public sealed class PdfNumber : PdfObjectInheritance
object ← PdfObject ← PdfNumber
Properties
Section titled “Properties”IntegerValue
Section titled “ IntegerValue”The integer value. Valid only when IsInteger is true.
public long IntegerValue { get; }Property Value
Section titled “Property Value”IsInteger
Section titled “ IsInteger”True for integers, false for reals.
public bool IsInteger { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”FromDouble(double)
Section titled “ FromDouble(double)”Creates a real, rounded to 6 decimal places and written without an exponent, as PDF requires. Whole values become integers.
public static PdfNumber FromDouble(double value)Parameters
Section titled “Parameters”value double
Returns
Section titled “Returns”Exceptions
Section titled “Exceptions”value is NaN or infinite.
FromInteger(long)
Section titled “ FromInteger(long)”Creates an integer.
public static PdfNumber FromInteger(long value)Parameters
Section titled “Parameters”value long
Returns
Section titled “Returns”ToDouble()
Section titled “ ToDouble()”The value as a double. Exact for integers up to 2^53.
public double ToDouble()Returns
Section titled “Returns”ToString()
Section titled “ ToString()”The number as written in the file.
public override string ToString()