iText 8.0.5 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  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

  PdfIndirectReference (PdfDocument doc, int objNr)
 
  PdfIndirectReference (PdfDocument doc, int objNr, int genNr)
 
  PdfIndirectReference (PdfDocument doc, int objNr, int genNr, long offset)
 
virtual void  SetRefersTo (PdfObject refersTo)
 
virtual PdfWriter  GetWriter ()
  Gets a PdfWriter associated with the document object belongs to. More...
 
virtual PdfReader  GetReader ()
  Gets a PdfReader associated with the document object belongs to. More...
 
override PdfObject  NewInstance ()
  Creates new instance of object. More...
 
override void  CopyContent (PdfObject from, PdfDocument document, ICopyFilter copyFilter)
  Copies object content from object 'from'. More...
 
override void  CopyContent (PdfObject from, PdfDocument document)
  Copies object content from object 'from'. More...
 
override PdfObject  SetState (short state)
  Sets special states of current object. More...
 
- Package Functions inherited from iText.Kernel.Pdf.PdfObject
virtual PdfObject  SetIndirectReference (PdfIndirectReference indirectReference)
 
virtual bool  CheckState (short state)
  Checks state of the flag of current object. More...
 
virtual PdfObject  ClearState (short state)
  Clear state of the flag of current object. More...
 

Package Attributes

readonly int  objNr
  Object number. More...
 
int  genNr
  Object generation. More...
 
PdfObject  refersTo = null
  PdfObject that current PdfIndirectReference instance refers to. More...
 
int  objectStreamNumber = 0
  Indirect reference number of object stream containing refersTo object. More...
 
long  offsetOrIndex = 0
  Offset in a document of the refersTo object. More...
 
PdfDocument  pdfDocument = null
  PdfDocument object belongs to. More...
 
- Package Attributes inherited from iText.Kernel.Pdf.PdfObject
PdfIndirectReference  indirectReference = null
  If object is flushed the indirect reference is kept here. 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
 
- 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
  For internal usage only. 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...
 

Member Function Documentation

◆ CopyContent() [1/2]

override void iText.Kernel.Pdf.PdfIndirectReference.CopyContent ( PdfObject  from,
PdfDocument  document 
)
inlinepackagevirtual

Copies object content from object 'from'.

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

Reimplemented from iText.Kernel.Pdf.PdfObject.

◆ CopyContent() [2/2]

override void iText.Kernel.Pdf.PdfIndirectReference.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.

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

◆ GetReader()

virtual PdfReader iText.Kernel.Pdf.PdfIndirectReference.GetReader ( )
inlinepackagevirtual

Gets a PdfReader associated with the document object belongs to.

Returns
PdfReader.

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

Parameters
recursively

true to resolve indirects chain

Returns
the PdfObject result of indirect reference resolving

◆ GetWriter()

virtual PdfWriter iText.Kernel.Pdf.PdfIndirectReference.GetWriter ( )
inlinepackagevirtual

Gets a PdfWriter associated with the document object belongs to.

Returns
PdfWriter.

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

◆ NewInstance()

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

Creates new instance of object.

Returns
new instance of object.

Implements iText.Kernel.Pdf.PdfObject.

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

◆ SetState()

override PdfObject iText.Kernel.Pdf.PdfIndirectReference.SetState ( short  state )
inlinepackagevirtual

Sets special states of current object.

Parameters
state special flag of current object

Reimplemented from iText.Kernel.Pdf.PdfObject.

Member Data Documentation

◆ genNr

int iText.Kernel.Pdf.PdfIndirectReference.genNr
package

Object generation.

◆ objectStreamNumber

int iText.Kernel.Pdf.PdfIndirectReference.objectStreamNumber = 0
package

Indirect reference number of object stream containing refersTo object.

Indirect reference number of object stream containing refersTo object. If refersTo is not placed into object stream - objectStreamNumber = 0.

◆ objNr

readonly int iText.Kernel.Pdf.PdfIndirectReference.objNr
package

Object number.

◆ offsetOrIndex

long iText.Kernel.Pdf.PdfIndirectReference.offsetOrIndex = 0
package

Offset in a document of the refersTo object.

Offset in a document of the refersTo object. If the object placed into object stream then it is an object index inside object stream.

◆ pdfDocument

PdfDocument iText.Kernel.Pdf.PdfIndirectReference.pdfDocument = null
package

PdfDocument object belongs to.

PdfDocument object belongs to. For direct objects it is null.

◆ refersTo

PdfObject iText.Kernel.Pdf.PdfIndirectReference.refersTo = null
package

PdfObject that current PdfIndirectReference instance refers to.