Table of Contents

Class PdfObjectWrapper<T>

Namespace
iText.Kernel.Pdf
Assembly
itext.kernel.dll
public abstract class PdfObjectWrapper<T> where T : PdfObject

Type Parameters

T
Inheritance
PdfObjectWrapper<T>
Derived
Inherited Members

Constructors

PdfObjectWrapper(T)

protected PdfObjectWrapper(T pdfObject)

Parameters

pdfObject T

Methods

EnsureObjectIsAddedToDocument(PdfObject)

Some wrappers use object's indirect reference to obtain the PdfDocument to which the object belongs to.

protected static void EnsureObjectIsAddedToDocument(PdfObject @object)

Parameters

object PdfObject

the PdfObject to be checked if it is indirect.

Remarks

Some wrappers use object's indirect reference to obtain the PdfDocument to which the object belongs to. For this matter, for these wrappers it is implicitly defined that they work with indirect objects only. Commonly these wrappers have two constructors: one with PdfDocument as parameter to create a new object, and the other one which wraps around the given PdfObject . This method should be used in the second type of constructors to ensure that wrapper will able to obtain the PdfDocument instance.

EnsureUnderlyingObjectHasIndirectReference()

protected virtual void EnsureUnderlyingObjectHasIndirectReference()

Flush()

public virtual void Flush()

GetPdfObject()

public virtual T GetPdfObject()

Returns

T

IsFlushed()

public virtual bool IsFlushed()

Returns

bool

IsWrappedObjectMustBeIndirect()

Defines if the object behind this wrapper must be an indirect object in the resultant document.

protected abstract bool IsWrappedObjectMustBeIndirect()

Returns

bool

true if in the resultant document the object behind the wrapper must be indirect, otherwise false.

Remarks

Defines if the object behind this wrapper must be an indirect object in the resultant document.

If this method returns true it doesn't necessarily mean that object must be in the indirect state at any moment, but rather defines that when the object will be written to the document it will be transformed into indirect object if it's not indirect yet.

Return value of this method shouldn't depend on any logic, it should return always true or false.

MakeIndirect(PdfDocument)

Marks object behind wrapper to be saved as indirect.

public virtual PdfObjectWrapper<T> MakeIndirect(PdfDocument document)

Parameters

document PdfDocument

a document the indirect reference will belong to.

Returns

PdfObjectWrapper<T>

object itself.

MakeIndirect(PdfDocument, PdfIndirectReference)

Marks object behind wrapper to be saved as indirect.

public virtual PdfObjectWrapper<T> MakeIndirect(PdfDocument document, PdfIndirectReference reference)

Parameters

document PdfDocument

a document the indirect reference belongs to.

reference PdfIndirectReference

a reference which will be assigned for the object behind wrapper.

Returns

PdfObjectWrapper<T>

object itself.

MarkObjectAsIndirect(PdfObject)

protected static void MarkObjectAsIndirect(PdfObject pdfObject)

Parameters

pdfObject PdfObject

SetForbidRelease()

protected virtual void SetForbidRelease()

SetModified()

public virtual PdfObjectWrapper<T> SetModified()

Returns

PdfObjectWrapper<T>

SetPdfObject(T)

protected virtual void SetPdfObject(T pdfObject)

Parameters

pdfObject T

UnsetForbidRelease()

protected virtual void UnsetForbidRelease()