iText 9.0.0 API
iText.Kernel.Pdf.PdfNumber Class Reference

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

Inheritance diagram for iText.Kernel.Pdf.PdfNumber:
iText.Kernel.Pdf.PdfPrimitiveObject iText.Kernel.Pdf.PdfObject

Public Member Functions

  PdfNumber (double value)
  Creates an instance of PdfNumber and sets value. More...
 
  PdfNumber (int value)
  Creates an instance of PdfNumber and sets value. More...
 
  PdfNumber (byte[] content)
  Creates an instance of PdfNumber with provided content. More...
 
override byte  GetObjectType ()
  Gets object type. More...
 
virtual double  GetValue ()
  Returns value of current instance of PdfNumber. More...
 
virtual double  DoubleValue ()
  Returns double value of current instance of PdfNumber. More...
 
virtual float  FloatValue ()
  Returns value and converts it to float. More...
 
virtual long  LongValue ()
  Returns value and converts it to long. More...
 
virtual int  IntValue ()
  Returns value and converts it to an int. More...
 
virtual void  SetValue (int value)
  Sets value and convert it to double. More...
 
virtual void  SetValue (double value)
  Sets value. More...
 
virtual void  Increment ()
  Increments current value. More...
 
virtual void  Decrement ()
  Decrements current value. More...
 
override String  ToString ()
 
override bool  Equals (Object o)
 
virtual bool  HasDecimalPoint ()
  Checks if string representation of the value contains decimal point. More...
 
override int  GetHashCode ()
 
- Public Member Functions inherited from iText.Kernel.Pdf.PdfPrimitiveObject
override PdfObject  MakeIndirect (PdfDocument document, PdfIndirectReference reference)
  Marks object to be saved as indirect. More...
 
- Public Member Functions inherited from iText.Kernel.Pdf.PdfObject
void  Flush ()
  Flushes the object to the document. More...
 
void  Flush (bool canBeInObjStm)
  Flushes the object to the document. More...
 
virtual PdfIndirectReference  GetIndirectReference ()
  Gets the indirect reference associated with the object. More...
 
virtual bool  IsIndirect ()
  Checks if object is indirect. More...
 
virtual PdfObject  MakeIndirect (PdfDocument document)
  Marks object to be saved as indirect. More...
 
virtual bool  IsFlushed ()
  Indicates is the object has been flushed or not. More...
 
virtual bool  IsModified ()
  Indicates is the object has been set as modified or not. More...
 
virtual PdfObject  Clone ()
  Creates clone of the object which belongs to the same document as original object. More...
 
virtual PdfObject  Clone (ICopyFilter filter)
  Creates clone of the object which belongs to the same document as original object. More...
 
virtual PdfObject  CopyTo (PdfDocument document)
  Copies object to a specified document. More...
 
virtual PdfObject  CopyTo (PdfDocument document, bool allowDuplicating)
  Copies object to a specified document. More...
 
virtual PdfObject  CopyTo (PdfDocument document, ICopyFilter copyFilter)
  Copies object to a specified document. More...
 
virtual PdfObject  CopyTo (PdfDocument document, bool allowDuplicating, ICopyFilter copyFilter)
  Copies object to a specified document. More...
 
virtual PdfObject  SetModified ()
  Sets the 'modified' flag to the indirect object, the flag denotes that the object was modified since the document opening. More...
 
virtual bool  IsReleaseForbidden ()
  Checks if it's forbidden to release this PdfObject instance. More...
 
virtual void  Release ()
 
virtual bool  IsNull ()
  Checks if this PdfObject is of the type PdfNull. More...
 
virtual bool  IsBoolean ()
  Checks if this PdfObject is of the type PdfBoolean. More...
 
virtual bool  IsNumber ()
  Checks if this PdfObject is of the type PdfNumber. More...
 
virtual bool  IsString ()
  Checks if this PdfObject is of the type PdfString. More...
 
virtual bool  IsName ()
  Checks if this PdfObject is of the type PdfName. More...
 
virtual bool  IsArray ()
  Checks if this PdfObject is of the type PdfArray. More...
 
virtual bool  IsDictionary ()
  Checks if this PdfObject is of the type PdfDictionary. More...
 
virtual bool  IsStream ()
  Checks if this PdfObject is of the type PdfStream. More...
 
virtual bool  IsIndirectReference ()
  Checks if this PdfObject is of the type PdfIndirectReference. More...
 
virtual bool  IsLiteral ()
  Checks if this PdfObject is of the type PdfLiteral. More...
 

Package Functions

override PdfObject  NewInstance ()
  Creates new instance of object. More...
 
virtual bool  IsDoubleNumber ()
 
override void  GenerateContent ()
 
virtual void  GenerateValue ()
 
override void  CopyContent (PdfObject from, PdfDocument document, ICopyFilter copyFilter)
  Copies object content from object 'from'. More...
 
- Package Functions inherited from iText.Kernel.Pdf.PdfPrimitiveObject
  PdfPrimitiveObject (bool directOnly)
 
  PdfPrimitiveObject (byte[] content)
  Initialize PdfPrimitiveObject from the passed bytes. More...
 
byte[]  GetInternalContent ()
 
virtual bool  HasContent ()
 
override PdfObject  SetIndirectReference (PdfIndirectReference indirectReference)
 
override void  CopyContent (PdfObject from, PdfDocument document, ICopyFilter copyFilter)
  Copies object content from object 'from'. More...
 
virtual int  CompareContent (iText.Kernel.Pdf.PdfPrimitiveObject o)
 
- Package Functions inherited from iText.Kernel.Pdf.PdfObject
virtual bool  CheckState (short state)
  Checks state of the flag of current object. More...
 
virtual PdfObject  SetState (short state)
  Sets special states of current object. More...
 
virtual PdfObject  ClearState (short state)
  Clear state of the flag of current object. More...
 
virtual void  CopyContent (PdfObject from, PdfDocument document)
  Copies object content from object 'from'. More...
 

Additional Inherited Members

- Static Public Attributes inherited from iText.Kernel.Pdf.PdfObject
const byte  ARRAY = 1
 
const byte  BOOLEAN = 2
 
const byte  DICTIONARY = 3
 
const byte  LITERAL = 4
 
const byte  INDIRECT_REFERENCE = 5
 
const byte  NAME = 6
 
const byte  NULL = 7
 
const byte  NUMBER = 8
 
const byte  STREAM = 9
 
const byte  STRING = 10
 
- Package Attributes inherited from iText.Kernel.Pdf.PdfPrimitiveObject
byte[]  content = null
 
bool  directOnly
 
- Package Attributes inherited from iText.Kernel.Pdf.PdfObject
PdfIndirectReference  indirectReference = null
  If object is flushed the indirect reference is kept here. More...
 
- Static Package Attributes inherited from iText.Kernel.Pdf.PdfObject
const short  FLUSHED = 1
  Indicates if the object has been flushed. More...
 
const short  FREE = 1 << 1
  Indicates that the indirect reference of the object could be reused or have to be marked as free. More...
 
const short  READING = 1 << 2
  Indicates that definition of the indirect reference of the object still not found (e.g. keys in XRefStm). More...
 
const short  MODIFIED = 1 << 3
  Indicates that object changed (is used in append mode). More...
 
const short  ORIGINAL_OBJECT_STREAM = 1 << 4
  Indicates that the indirect reference of the object represents ObjectStream from original document. More...
 
const short  MUST_BE_FLUSHED = 1 << 5
  Marks objects that shall be written to the output document. More...
 
const short  MUST_BE_INDIRECT = 1 << 6
  Indicates that the object shall be indirect when it is written to the document. More...
 
const short  FORBID_RELEASE = 1 << 7
  Indicates that the object is highly sensitive and we do not want to release it even if release() is called. More...
 
const short  READ_ONLY = 1 << 8
  Indicates that we do not want this object to be ever written into the resultant document (because of multiple objects read from the same reference inconsistency). More...
 
const short  UNENCRYPTED = 1 << 9
  Indicates that this object is not encrypted in the encrypted document. More...
 

Detailed Description

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

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).

Constructor & Destructor Documentation

◆ PdfNumber() [1/3]

iText.Kernel.Pdf.PdfNumber.PdfNumber ( double  value )
inline

Creates an instance of PdfNumber and sets value.

Parameters
value double value to set

◆ PdfNumber() [2/3]

iText.Kernel.Pdf.PdfNumber.PdfNumber ( int  value )
inline

Creates an instance of PdfNumber and sets value.

Parameters
value int value to set

◆ PdfNumber() [3/3]

iText.Kernel.Pdf.PdfNumber.PdfNumber ( byte[]  content )
inline

Creates an instance of PdfNumber with provided content.

Parameters
content byte array content to set

Member Function Documentation

◆ CopyContent()

override void iText.Kernel.Pdf.PdfNumber.CopyContent ( PdfObject  from,
PdfDocument  document,
ICopyFilter  filter 
)
inlinepackagevirtual

Copies object content from object 'from'.

Parameters
from object to copy content from.
document document to copy object to.
filter

iText.Kernel.Utils.ICopyFilter a filter that will apply on dictionaries and array Use iText.Kernel.Utils.NullCopyFilter for no filtering

Reimplemented from iText.Kernel.Pdf.PdfObject.

◆ Decrement()

virtual void iText.Kernel.Pdf.PdfNumber.Decrement ( )
inlinevirtual

Decrements current value.

◆ DoubleValue()

virtual double iText.Kernel.Pdf.PdfNumber.DoubleValue ( )
inlinevirtual

Returns double value of current instance of PdfNumber.

Returns
double value of PdfNumber instance

◆ FloatValue()

virtual float iText.Kernel.Pdf.PdfNumber.FloatValue ( )
inlinevirtual

Returns value and converts it to float.

Returns
value converted to float

◆ GetObjectType()

override byte iText.Kernel.Pdf.PdfNumber.GetObjectType ( )
inlinevirtual

Gets object type.

Returns
object type.

Implements iText.Kernel.Pdf.PdfObject.

◆ GetValue()

virtual double iText.Kernel.Pdf.PdfNumber.GetValue ( )
inlinevirtual

Returns value of current instance of PdfNumber.

Returns
value of PdfNumber instance

◆ HasDecimalPoint()

virtual bool iText.Kernel.Pdf.PdfNumber.HasDecimalPoint ( )
inlinevirtual

Checks if string representation of the value contains decimal point.

Returns
true if contains so the number must be real not integer

◆ Increment()

virtual void iText.Kernel.Pdf.PdfNumber.Increment ( )
inlinevirtual

Increments current value.

◆ IntValue()

virtual int iText.Kernel.Pdf.PdfNumber.IntValue ( )
inlinevirtual

Returns value and converts it to an int.

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

Returns
value converted to int

◆ LongValue()

virtual long iText.Kernel.Pdf.PdfNumber.LongValue ( )
inlinevirtual

Returns value and converts it to long.

Returns
value converted to long

◆ NewInstance()

override PdfObject iText.Kernel.Pdf.PdfNumber.NewInstance ( )
inlinepackagevirtual

Creates new instance of object.

Returns
new instance of object.

Implements iText.Kernel.Pdf.PdfObject.

◆ SetValue() [1/2]

virtual void iText.Kernel.Pdf.PdfNumber.SetValue ( double  value )
inlinevirtual

Sets value.

Parameters
value to set

◆ SetValue() [2/2]

virtual void iText.Kernel.Pdf.PdfNumber.SetValue ( int  value )
inlinevirtual

Sets value and convert it to double.

Parameters
value to set