iText 7 7.1.9 API
iText.Kernel.Pdf.PdfIndirectReference Class Reference
Inheritance diagram for iText.Kernel.Pdf.PdfIndirectReference:
iText.Kernel.Pdf.PdfObject

Public Member Functions

virtual int  GetObjNumber ()
 
virtual int  GetGenNumber ()
 
virtual PdfObject  GetRefersTo ()
 
virtual PdfObject  GetRefersTo (bool recursively)
  Gets direct object and try to resolve indirects chain. More...
 
virtual int  GetObjStreamNumber ()
 
virtual long  GetOffset ()
  Gets refersTo object offset in a document. More...
 
virtual int  GetIndex ()
  Gets refersTo object index in the object stream. More...
 
override bool  Equals (Object o)
 
override int  GetHashCode ()
 
virtual int  CompareTo (iText.Kernel.Pdf.PdfIndirectReference o)
 
override byte  GetObjectType ()
  Gets object type. More...
 
virtual PdfDocument  GetDocument ()
 
virtual void  SetFree ()
  Marks indirect reference as free in the document. More...
 
virtual bool  IsFree ()
  Checks if this PdfIndirectReference instance corresponds to free indirect reference. More...
 
override String  ToString ()
 
- 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, 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  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  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...
 

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
 

Member Function Documentation

◆ GetIndex()

virtual int iText.Kernel.Pdf.PdfIndirectReference.GetIndex ( )
inlinevirtual

Gets refersTo object index in the object stream.

Returns
object index in a document. If refersTo object is not in object stream then -1.

◆ GetObjectType()

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

Gets object type.

Returns
object type.

Implements iText.Kernel.Pdf.PdfObject.

◆ GetOffset()

virtual long iText.Kernel.Pdf.PdfIndirectReference.GetOffset ( )
inlinevirtual

Gets refersTo object offset in a document.

Returns
object offset in a document. If refersTo object is in object stream then -1.

◆ GetRefersTo()

virtual PdfObject iText.Kernel.Pdf.PdfIndirectReference.GetRefersTo ( bool  recursively )
inlinevirtual

Gets direct object and try to resolve indirects chain.

Gets direct object and try to resolve indirects chain.

Note: If chain of references has length of more than 32, this method return 31st reference in chain.

◆ IsFree()

virtual bool iText.Kernel.Pdf.PdfIndirectReference.IsFree ( )
inlinevirtual

Checks if this PdfIndirectReference instance corresponds to free indirect reference.

Checks if this PdfIndirectReference instance corresponds to free indirect reference. Indirect reference might be in a free state either because it was read as such from the opened existing PDF document or because it was set free via SetFree() method.

Returns

true if this PdfIndirectReference is free, false otherwise.

◆ SetFree()

virtual void iText.Kernel.Pdf.PdfIndirectReference.SetFree ( )
inlinevirtual

Marks indirect reference as free in the document.

Marks indirect reference as free in the document. This doesn't "remove" indirect objects from the document, it only ensures that corresponding xref entry is free and indirect object referred by this reference is no longer linked to it. Actual object still might be written to the resultant document (and would get a new corresponding indirect reference in this case) if it is still contained in some other object.

This method will not give any result if the corresponding indirect object or another object that contains a reference to this object is already flushed.

Note: in some cases, removing a link of indirect object to it's indirect reference while leaving the actual object in the document structure might lead to errors, because some objects are expected to always have such explicit link (e.g. Catalog object, page objects, etc).