Class PdfIndirectReference
public class PdfIndirectReference : PdfObject, IComparable<PdfIndirectReference>
- Inheritance
-
PdfIndirectReference
- Implements
- Inherited Members
Constructors
PdfIndirectReference(PdfDocument, int)
protected PdfIndirectReference(PdfDocument doc, int objNr)
Parameters
doc
PdfDocumentobjNr
int
PdfIndirectReference(PdfDocument, int, int)
protected PdfIndirectReference(PdfDocument doc, int objNr, int genNr)
Parameters
doc
PdfDocumentobjNr
intgenNr
int
PdfIndirectReference(PdfDocument, int, int, long)
protected PdfIndirectReference(PdfDocument doc, int objNr, int genNr, long offset)
Parameters
doc
PdfDocumentobjNr
intgenNr
intoffset
long
Fields
genNr
Object generation.
protected int genNr
Field Value
objNr
Object number.
protected readonly int objNr
Field Value
objectStreamNumber
Indirect reference number of object stream containing refersTo object.
protected int objectStreamNumber
Field Value
Remarks
Indirect reference number of object stream containing refersTo object. If refersTo is not placed into object stream - objectStreamNumber = 0.
offsetOrIndex
Offset in a document of the
refersTo
object.
protected long offsetOrIndex
Field Value
Remarks
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 object belongs to.
protected PdfDocument pdfDocument
Field Value
Remarks
PdfDocument object belongs to. For direct objects it is null.
refersTo
PdfObject that current PdfIndirectReference instance refers to.
protected PdfObject refersTo
Field Value
Methods
CompareTo(PdfIndirectReference)
public virtual int CompareTo(PdfIndirectReference o)
Parameters
Returns
CopyContent(PdfObject, PdfDocument)
protected override void CopyContent(PdfObject from, PdfDocument document)
Parameters
from
PdfObjectdocument
PdfDocument
CopyContent(PdfObject, PdfDocument, ICopyFilter)
protected override void CopyContent(PdfObject from, PdfDocument document, ICopyFilter copyFilter)
Parameters
from
PdfObjectdocument
PdfDocumentcopyFilter
ICopyFilter
Equals(object)
public override bool Equals(object o)
Parameters
o
object
Returns
GetDocument()
public virtual PdfDocument GetDocument()
Returns
GetGenNumber()
public virtual int GetGenNumber()
Returns
GetHashCode()
public override int GetHashCode()
Returns
GetIndex()
Gets refersTo object index in the object stream.
public virtual int GetIndex()
Returns
- int
object index in a document. If refersTo object is not in object stream then -1.
GetObjNumber()
public virtual int GetObjNumber()
Returns
GetObjStreamNumber()
public virtual int GetObjStreamNumber()
Returns
GetObjectType()
public override byte GetObjectType()
Returns
GetOffset()
Gets refersTo object offset in a document.
public virtual long GetOffset()
Returns
- long
object offset in a document. If refersTo object is in object stream then -1.
GetReader()
Gets a PdfReader associated with the document object belongs to.
protected virtual PdfReader GetReader()
Returns
- PdfReader
PdfReader.
GetRefersTo()
public virtual PdfObject GetRefersTo()
Returns
GetRefersTo(bool)
Gets direct object and try to resolve indirects chain.
public virtual PdfObject GetRefersTo(bool recursively)
Parameters
Returns
Remarks
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.GetWriter()
Gets a PdfWriter associated with the document object belongs to.
protected virtual PdfWriter GetWriter()
Returns
- PdfWriter
PdfWriter.
IsFree()
Checks if this PdfIndirectReference instance corresponds to free indirect reference.
public virtual bool IsFree()
Returns
- bool
true if this PdfIndirectReference is free, false otherwise.
Remarks
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.
NewInstance()
protected override PdfObject NewInstance()
Returns
SetFree()
Marks indirect reference as free in the document.
public virtual void SetFree()
Remarks
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).SetRefersTo(PdfObject)
protected virtual void SetRefersTo(PdfObject refersTo)
Parameters
refersTo
PdfObject
SetState(short)
Sets special states of current object.
protected override PdfObject SetState(short state)
Parameters
state
shortspecial flag of current object
Returns
ToString()
public override string ToString()