iText 8.0.2 API
iText.Kernel.Pdf.PdfObject Class Referenceabstract
Inheritance diagram for iText.Kernel.Pdf.PdfObject:
iText.Kernel.Pdf.PdfArray iText.Kernel.Pdf.PdfDictionary iText.Kernel.Pdf.PdfIndirectReference iText.Kernel.Pdf.PdfPrimitiveObject iText.Kernel.Pdf.PdfTextArray iText.Kernel.Pdf.PdfStream iText.Kernel.Pdf.PdfBoolean iText.Kernel.Pdf.PdfLiteral iText.Kernel.Pdf.PdfName iText.Kernel.Pdf.PdfNull iText.Kernel.Pdf.PdfNumber iText.Kernel.Pdf.PdfString

Public Member Functions

abstract byte  GetObjectType ()
  Gets object type. More...
 
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, PdfIndirectReference reference)
  Marks object to be saved as 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...
 

Static Public Attributes

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
 

Member Function Documentation

◆ Clone() [1/2]

virtual PdfObject iText.Kernel.Pdf.PdfObject.Clone ( )
inlinevirtual

Creates clone of the object which belongs to the same document as original object.

Creates clone of the object which belongs to the same document as original object. New object shall not be used in other documents.

Returns
cloned object.

◆ Clone() [2/2]

virtual PdfObject iText.Kernel.Pdf.PdfObject.Clone ( ICopyFilter  filter )
inlinevirtual

Creates clone of the object which belongs to the same document as original object.

Creates clone of the object which belongs to the same document as original object. New object shall not be used in other documents.

Parameters
filter Filter what will be copied or not
Returns
cloned object.

◆ CopyTo() [1/4]

virtual PdfObject iText.Kernel.Pdf.PdfObject.CopyTo ( PdfDocument  document )
inlinevirtual

Copies object to a specified document.

Copies object to a specified document.

NOTE: Works only for objects that are read from document opened in reading mode, otherwise an exception is thrown.

Parameters
document document to copy object to.
Returns
copied object.

◆ CopyTo() [2/4]

virtual PdfObject iText.Kernel.Pdf.PdfObject.CopyTo ( PdfDocument  document,
bool  allowDuplicating 
)
inlinevirtual

Copies object to a specified document.

Copies object to a specified document.

NOTE: Works only for objects that are read from document opened in reading mode, otherwise an exception is thrown.

Parameters
document document to copy object to.
allowDuplicating indicates if to allow copy objects which already have been copied. If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. If allowDuplicating is true then object will be copied and new indirect reference will be assigned.
Returns
copied object.

◆ CopyTo() [3/4]

virtual PdfObject iText.Kernel.Pdf.PdfObject.CopyTo ( PdfDocument  document,
bool  allowDuplicating,
ICopyFilter  copyFilter 
)
inlinevirtual

Copies object to a specified document.

Copies object to a specified document.

NOTE: Works only for objects that are read from document opened in reading mode, otherwise an exception is thrown.

Parameters
document document to copy object to.
allowDuplicating indicates if to allow copy objects which already have been copied. If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. If allowDuplicating is true then object will be copied and new indirect reference will be assigned.
copyFilter

iText.Kernel.Utils.ICopyFilter a filter to apply while copying arrays and dictionaries Use iText.Kernel.Utils.NullCopyFilter for no filtering

Returns
copied object.

◆ CopyTo() [4/4]

virtual PdfObject iText.Kernel.Pdf.PdfObject.CopyTo ( PdfDocument  document,
ICopyFilter  copyFilter 
)
inlinevirtual

Copies object to a specified document.

Copies object to a specified document.

NOTE: Works only for objects that are read from document opened in reading mode, otherwise an exception is thrown.

Parameters
document document to copy object to.
copyFilter

iText.Kernel.Utils.ICopyFilter a filter to apply while copying arrays and dictionaries Use iText.Kernel.Utils.NullCopyFilter for no filtering

Returns
copied object.

◆ Flush() [1/2]

void iText.Kernel.Pdf.PdfObject.Flush ( )
inline

Flushes the object to the document.

◆ Flush() [2/2]

void iText.Kernel.Pdf.PdfObject.Flush ( bool  canBeInObjStm )
inline

Flushes the object to the document.

Parameters
canBeInObjStm indicates whether object can be placed into object stream.

◆ GetIndirectReference()

virtual PdfIndirectReference iText.Kernel.Pdf.PdfObject.GetIndirectReference ( )
inlinevirtual

Gets the indirect reference associated with the object.

Gets the indirect reference associated with the object. The indirect reference is used when flushing object to the document.

Returns
indirect reference.

◆ GetObjectType()

◆ IsArray()

virtual bool iText.Kernel.Pdf.PdfObject.IsArray ( )
inlinevirtual

Checks if this PdfObject is of the type PdfArray.

Returns
true or false

◆ IsBoolean()

virtual bool iText.Kernel.Pdf.PdfObject.IsBoolean ( )
inlinevirtual

Checks if this PdfObject is of the type PdfBoolean.

Returns
true or false

◆ IsDictionary()

virtual bool iText.Kernel.Pdf.PdfObject.IsDictionary ( )
inlinevirtual

Checks if this PdfObject is of the type PdfDictionary.

Returns
true or false

◆ IsFlushed()

virtual bool iText.Kernel.Pdf.PdfObject.IsFlushed ( )
inlinevirtual

Indicates is the object has been flushed or not.

Returns
true if object has been flushed, otherwise false.

◆ IsIndirect()

virtual bool iText.Kernel.Pdf.PdfObject.IsIndirect ( )
inlinevirtual

Checks if object is indirect.

Checks if object is indirect.
Note: Return value true doesn't necessarily mean that indirect reference of this object is not null at the moment. Object could be marked as indirect and be transformed to indirect on flushing.
E.g. all PdfStreams are transformed to indirect objects when they are written, but they don't always have indirect references at any given moment.

Returns
returns true if object is indirect or is to be indirect in the resultant document.

◆ IsIndirectReference()

virtual bool iText.Kernel.Pdf.PdfObject.IsIndirectReference ( )
inlinevirtual

Checks if this PdfObject is of the type PdfIndirectReference.

Returns
true if this is an indirect reference, otherwise false

◆ IsLiteral()

virtual bool iText.Kernel.Pdf.PdfObject.IsLiteral ( )
inlinevirtual

Checks if this PdfObject is of the type PdfLiteral.

Returns
true if this is a literal, otherwise false

◆ IsModified()

virtual bool iText.Kernel.Pdf.PdfObject.IsModified ( )
inlinevirtual

Indicates is the object has been set as modified or not.

Indicates is the object has been set as modified or not. Useful for incremental updates (e.g. appendMode).

Returns
true is object has been set as modified, otherwise false.

◆ IsName()

virtual bool iText.Kernel.Pdf.PdfObject.IsName ( )
inlinevirtual

Checks if this PdfObject is of the type PdfName.

Returns
true or false

◆ IsNull()

virtual bool iText.Kernel.Pdf.PdfObject.IsNull ( )
inlinevirtual

Checks if this PdfObject is of the type PdfNull.

Returns
true or false

◆ IsNumber()

virtual bool iText.Kernel.Pdf.PdfObject.IsNumber ( )
inlinevirtual

Checks if this PdfObject is of the type PdfNumber.

Returns
true or false

◆ IsReleaseForbidden()

virtual bool iText.Kernel.Pdf.PdfObject.IsReleaseForbidden ( )
inlinevirtual

Checks if it's forbidden to release this PdfObject instance.

Checks if it's forbidden to release this PdfObject instance. Some objects are vital for the living period of PdfDocument or may be prevented from releasing by high-level entities dealing with the objects. Also it's not possible to release the objects that have been modified.

Returns
true if releasing this object is forbidden, otherwise false

◆ IsStream()

virtual bool iText.Kernel.Pdf.PdfObject.IsStream ( )
inlinevirtual

Checks if this PdfObject is of the type PdfStream.

Returns
true or false

◆ IsString()

virtual bool iText.Kernel.Pdf.PdfObject.IsString ( )
inlinevirtual

Checks if this PdfObject is of the type PdfString.

Returns
true or false

◆ MakeIndirect() [1/2]

virtual PdfObject iText.Kernel.Pdf.PdfObject.MakeIndirect ( PdfDocument  document )
inlinevirtual

Marks object to be saved as indirect.

Parameters
document a document the indirect reference will belong to.
Returns
object itself.

◆ MakeIndirect() [2/2]

virtual PdfObject iText.Kernel.Pdf.PdfObject.MakeIndirect ( PdfDocument  document,
PdfIndirectReference  reference 
)
inlinevirtual

Marks object to be saved as indirect.

Parameters
document a document the indirect reference will belong to.
reference indirect reference which will be associated with this document
Returns
object itself.

Reimplemented in iText.Kernel.Pdf.PdfPrimitiveObject.

◆ SetModified()

virtual PdfObject iText.Kernel.Pdf.PdfObject.SetModified ( )
inlinevirtual

Sets the 'modified' flag to the indirect object, the flag denotes that the object was modified since the document opening.

Sets the 'modified' flag to the indirect object, the flag denotes that the object was modified since the document opening. It is recommended to set this flag after changing any PDF object.

For example flag is used in the append mode (see StampingProperties.UseAppendMode() ). In append mode the whole document is preserved as is, and only changes to the document are appended to the end of the document file. Because of this, only modified objects need to be flushed and are allowed to be flushed (i.e. to be written).

Returns
this PdfObject instance.