Table of Contents

Class PdfInternals

Namespace
PdfSharp.Pdf.Advanced
Assembly
PdfSharp.dll

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
PdfInternals
Inherited Members

Fields

CustomValueKey

The name of the custom value key.

public string CustomValueKey

Field Value

string

Properties

AllObjects

Gets all indirect objects ordered by their object identifier.

[Obsolete("Use GetAllObjects.")]
public PdfObject[] AllObjects { get; }

Property Value

PdfObject[]

Catalog

Gets the catalog dictionary.

public PdfCatalog Catalog { get; }

Property Value

PdfCatalog

ExtGStateTable

Gets the ExtGStateTable object.

public PdfExtGStateTable ExtGStateTable { get; }

Property Value

PdfExtGStateTable

FirstDocumentGuid

Gets the first document identifier as GUID.

public Guid FirstDocumentGuid { get; }

Property Value

Guid

FirstDocumentID

Gets or sets the first document identifier.

public string FirstDocumentID { get; set; }

Property Value

string

SecondDocumentGuid

Gets the first document identifier as GUID.

public Guid SecondDocumentGuid { get; }

Property Value

Guid

SecondDocumentID

Gets or sets the second document identifier.

public string SecondDocumentID { get; set; }

Property Value

string

UAManager

This property is not documented by intention.

public object? UAManager { get; }

Property Value

object

Methods

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

CreateIndirectObject<T>()

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

public T CreateIndirectObject<T>() where T : PdfObject

Returns

T

Type Parameters

T

GenerationNumber(PdfObject)

Gets the generation number of the specified object.

public static int GenerationNumber(PdfObject obj)

Parameters

obj PdfObject

Returns

int

GetAllObjects()

Gets all indirect objects ordered by their object identifier.

public PdfObject[] GetAllObjects()

Returns

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, int)

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 int

Returns

PdfObject[]

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

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

int

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

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

RemoveObject(PdfObject)

Removes an object from the PDF document.

public void RemoveObject(PdfObject obj)

Parameters

obj PdfObject

WriteObject(Stream, PdfItem)

Writes a PdfItem into the specified stream.

public void WriteObject(Stream stream, PdfItem item)

Parameters

stream Stream
item PdfItem