Table of Contents

Method GetObject

Namespace
PdfSharp.Pdf
Assembly
PdfSharp.dll

GetObject(int, VCF, Type?)

Gets the PdfObject with the specified index, or null if no such object exists. If the index refers to a reference, the referenced PdfObject is returned.

public PdfObject? GetObject(int index, VCF options = VCF.None, Type? valueType = null)

Parameters

index int
options VCF
valueType Type

Returns

PdfObject

GetObject<T>(int, VCF)

Gets a PDF object of type T from the specified index. If the found object is a PDF reference or a PDF container (array or dictionary) but not of type T it is tried to be transformed into this type and replaces the old object. If the transformation is not possible, e.g. because T does not match with the found type, an exception is thrown. Returns null if the found object is neither a PDF reference nor a PDF container.

public T? GetObject<T>(int index, VCF options = VCF.None) where T : PdfObject

Parameters

index int

The 0-based index of the object.

options VCF

Returns

T

Type Parameters

T

The type of the PDF object to get.