PDFsharp-net6

PdfInternals

Namespace: PdfSharp.Pdf.Advanced

Provides access to the internal document data structures. This class prevents the public interfaces from pollution with too many internal functions.

public class PdfInternals

Inheritance ObjectPdfInternals

Fields

CustomValueKey

The name of the custom value key.

public string CustomValueKey;

Properties

FirstDocumentID

Gets or sets the first document identifier.

public string FirstDocumentID { get; set; }

Property Value

String

FirstDocumentGuid

Gets the first document identifier as GUID.

public Guid FirstDocumentGuid { get; }

Property Value

Guid

SecondDocumentID

Gets or sets the second document identifier.

public string SecondDocumentID { get; set; }

Property Value

String

SecondDocumentGuid

Gets the first document identifier as GUID.

public Guid SecondDocumentGuid { get; }

Property Value

Guid

Catalog

Gets the catalog dictionary.

public PdfCatalog Catalog { get; }

Property Value

PdfCatalog

ExtGStateTable

Gets the ExtGStateTable object.

public PdfExtGStateTable ExtGStateTable { get; }

Property Value

PdfExtGStateTable

UAManager

This property is not documented by intention.

public object UAManager { get; }

Property Value

Object

AllObjects

Caution

Use GetAllObjects.


Gets all indirect objects ordered by their object identifier.

public PdfObject[] AllObjects { get; }

Property Value

PdfObject[]

Methods

GetObject(PdfObjectID)

Returns the object with the specified Identifier, or null if no such object exists.

public PdfObject GetObject(PdfObjectID objectID)

Parameters

objectID PdfObjectID

Returns

PdfObject

MapExternalObject(PdfObject)

Maps the specified external object to the substitute object in this document. Returns null if no such object exists.

public PdfObject MapExternalObject(PdfObject externalObject)

Parameters

externalObject PdfObject

Returns

PdfObject

GetReference(PdfObject)

Returns the PdfReference of the specified object, or null if the object is not in the document’s object table.

public static PdfReference GetReference(PdfObject obj)

Parameters

obj PdfObject

Returns

PdfReference

GetObjectID(PdfObject)

Gets the object identifier of the specified object.

public static PdfObjectID GetObjectID(PdfObject obj)

Parameters

obj PdfObject

Returns

PdfObjectID

GetObjectNumber(PdfObject)

Gets the object number of the specified object.

public static int GetObjectNumber(PdfObject obj)

Parameters

obj PdfObject

Returns

Int32

GenerationNumber(PdfObject)

Gets the generation number of the specified object.

public static int GenerationNumber(PdfObject obj)

Parameters

obj PdfObject

Returns

Int32

GetAllObjects()

Gets all indirect objects ordered by their object identifier.

public PdfObject[] GetAllObjects()

Returns

PdfObject[]

CreateIndirectObject<T>()

Creates the indirect object of the specified type, adds it to the document, and returns the object.

public T CreateIndirectObject<T>()

Type Parameters

T

Returns

T

AddObject(PdfObject)

Adds an object to the PDF document. This operation and only this operation makes the object an indirect object owned by this document.

public void AddObject(PdfObject obj)

Parameters

obj PdfObject

RemoveObject(PdfObject)

Removes an object from the PDF document.

public void RemoveObject(PdfObject obj)

Parameters

obj PdfObject

GetClosure(PdfObject)

Returns an array containing the specified object as first element follows by its transitive closure. The closure of an object are all objects that can be reached by indirect references. The transitive closure is the result of applying the calculation of the closure to a closure as long as no new objects came along. This is e.g. useful for getting all objects belonging to the resources of a page.

public PdfObject[] GetClosure(PdfObject obj)

Parameters

obj PdfObject

Returns

PdfObject[]

GetClosure(PdfObject, Int32)

Returns an array containing the specified object as first element follows by its transitive closure limited by the specified number of iterations.

public PdfObject[] GetClosure(PdfObject obj, int depth)

Parameters

obj PdfObject

depth Int32

Returns

PdfObject[]

WriteObject(Stream, PdfItem)

Writes a PdfItem into the specified stream.

public void WriteObject(Stream stream, PdfItem item)

Parameters

stream Stream

item PdfItem