Table of Contents

Class PdfNumber

Namespace
MiPdf.Objects
Assembly
MiPdf.dll

A PDF numeric object; either an integer or a real number.

public sealed class PdfNumber : PdfObject
Inheritance
PdfNumber
Inherited Members

Constructors

PdfNumber(double)

Creates a real number.

public PdfNumber(double value)

Parameters

value double

PdfNumber(int)

Creates an integer number.

public PdfNumber(int value)

Parameters

value int

PdfNumber(long)

Creates an integer number.

public PdfNumber(long value)

Parameters

value long

Properties

IntValue

The value as int, rounded like LongValue and clamped to the int range.

public int IntValue { get; }

Property Value

int

IsInteger

True if the number was created or parsed as an integer.

public bool IsInteger { get; }

Property Value

bool

LongValue

The value as long; a real number is rounded to the nearest integer (as by the constructor).

public long LongValue { get; }

Property Value

long

ObjectType

The kind of this object.

public override PdfObjectType ObjectType { get; }

Property Value

PdfObjectType

Value

The value as double.

public double Value { get; }

Property Value

double

Methods

Clone()

Returns this instance (the object is immutable).

public override PdfObject Clone()

Returns

PdfObject

Equals(object?)

True if obj is a PdfNumber with the same value. Two integers are compared as integers, otherwise the real values are compared.

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Operators

implicit operator PdfNumber(double)

Converts a double to a real number.

public static implicit operator PdfNumber(double value)

Parameters

value double

Returns

PdfNumber

implicit operator PdfNumber(int)

Converts an int to an integer number.

public static implicit operator PdfNumber(int value)

Parameters

value int

Returns

PdfNumber