Table of Contents

Class PdfNumber

Namespace
iText.Kernel.Pdf
Assembly
itext.kernel.dll

A PdfNumber -class is the PDF-equivalent of a Double -object.

public class PdfNumber : PdfPrimitiveObject
Inheritance
PdfNumber
Inherited Members

Remarks

A PdfNumber -class is the PDF-equivalent of a Double -object.

PDF provides two types of numeric objects: integer and real. Integer objects represent mathematical integers. Real objects represent mathematical real numbers. The range and precision of numbers may be limited by the internal representations used in the computer on which the PDF processor is running. An integer shall be written as one or more decimal digits optionally preceded by a sign. The value shall be interpreted as a signed decimal integer and shall be converted to an integer object. A real value shall be written as one or more decimal digits with an optional sign and a leading, trailing, or embedded period (decimal point).

Constructors

PdfNumber(byte[])

Creates an instance of PdfNumber with provided content.

public PdfNumber(byte[] content)

Parameters

content byte[]

byte array content to set

PdfNumber(double)

Creates an instance of PdfNumber and sets value.

public PdfNumber(double value)

Parameters

value double

double value to set

PdfNumber(int)

Creates an instance of PdfNumber and sets value.

public PdfNumber(int value)

Parameters

value int

int value to set

Methods

CopyContent(PdfObject, PdfDocument, ICopyFilter)

protected override void CopyContent(PdfObject from, PdfDocument document, ICopyFilter copyFilter)

Parameters

from PdfObject
document PdfDocument
copyFilter ICopyFilter

Decrement()

Decrements current value.

public virtual void Decrement()

DoubleValue()

Returns double value of current instance of PdfNumber.

public virtual double DoubleValue()

Returns

double

double value of PdfNumber instance

Equals(object)

public override bool Equals(object o)

Parameters

o object

Returns

bool

FloatValue()

Returns value and converts it to float.

public virtual float FloatValue()

Returns

float

value converted to float

GenerateContent()

protected override void GenerateContent()

GenerateValue()

protected virtual void GenerateValue()

GetHashCode()

public override int GetHashCode()

Returns

int

GetObjectType()

public override byte GetObjectType()

Returns

byte

GetValue()

Returns value of current instance of PdfNumber.

public virtual double GetValue()

Returns

double

value of PdfNumber instance

HasDecimalPoint()

Checks if string representation of the value contains decimal point.

public virtual bool HasDecimalPoint()

Returns

bool

true if contains so the number must be real not integer

Increment()

Increments current value.

public virtual void Increment()

IntValue()

Returns value and converts it to an int.

public virtual int IntValue()

Returns

int

value converted to int

Remarks

Returns value and converts it to an int. If value surpasses MaxValue , MaxValue would be return.

IsDoubleNumber()

protected virtual bool IsDoubleNumber()

Returns

bool

LongValue()

Returns value and converts it to long.

public virtual long LongValue()

Returns

long

value converted to long

NewInstance()

protected override PdfObject NewInstance()

Returns

PdfObject

SetValue(double)

Sets value.

public virtual void SetValue(double value)

Parameters

value double

to set

SetValue(int)

Sets value and convert it to double.

public virtual void SetValue(int value)

Parameters

value int

to set

ToString()

public override string ToString()

Returns

string