PDFsharp-net6

PdfObject

Namespace: PdfSharp.Pdf

Base class of all composite PDF objects.

public abstract class PdfObject : PdfItem, System.ICloneable

Inheritance ObjectPdfItemPdfObject
Implements ICloneable

Properties

Owner

Gets the PdfDocument this object belongs to.

public PdfDocument Owner { get; }

Property Value

PdfDocument

IsIndirect

Indicates whether the object is an indirect object.

public bool IsIndirect { get; }

Property Value

Boolean

Internals

Gets the PdfInternals object of this document, that grants access to some internal structures which are not part of the public interface of PdfDocument.

public PdfObjectInternals Internals { get; }

Property Value

PdfObjectInternals

Reference

Gets the indirect reference of this object. If the value is null, this object is a direct object.

public PdfReference Reference { get; internal set; }

Property Value

PdfReference

ReferenceNotNull

Gets the indirect reference of this object. Throws if it is null.

public PdfReference ReferenceNotNull { get; }

Property Value

PdfReference

Exceptions

InvalidOperationException
The indirect reference must be not null here.

Methods

Clone()

Creates a copy of this object. The clone does not belong to a document, i.e. its owner and its iref are null.

public PdfObject Clone()

Returns

PdfObject

Copy()

Implements the copy mechanism. Must be overridden in derived classes.

protected object Copy()

Returns

Object

SetObjectID(Int32, Int32)

Sets the object and generation number. Setting the object identifier makes this object an indirect object, i.e. the object gets a PdfReference entry in the PdfReferenceTable.

internal void SetObjectID(int objectNumber, int generationNumber)

Parameters

objectNumber Int32

generationNumber Int32

PrepareForSave()

When overridden in a derived class, prepares the object to get saved.

internal void PrepareForSave()

WriteObject(PdfWriter)

Saves the stream position. 2nd Edition.

internal void WriteObject(PdfWriter writer)

Parameters

writer PdfWriter

DeepCopyClosure(PdfDocument, PdfObject)

internal static PdfObject DeepCopyClosure(PdfDocument owner, PdfObject externalObject)

Parameters

owner PdfDocument
The document that owns the cloned objects.

externalObject PdfObject
The root object to be cloned.

Returns

PdfObject
The clone of the root object

ImportClosure(PdfImportedObjectTable, PdfDocument, PdfObject)

internal static PdfObject ImportClosure(PdfImportedObjectTable importedObjectTable, PdfDocument owner, PdfObject externalObject)

Parameters

importedObjectTable PdfImportedObjectTable
The imported object table of the owner for the external document.

owner PdfDocument
The document that owns the cloned objects.

externalObject PdfObject
The root object to be cloned.

Returns

PdfObject
The clone of the root object