Skip to main content

Class PdfDictionary

Namespace: AdCodicem.Pdf.Objects
Assembly: AdCodicem.Pdf.dll

Represents a PDF dictionary.

public sealed class PdfDictionary : PdfObject, IEnumerable<KeyValuePair<PdfName, PdfObject>>, IEnumerable

Inheritance​

object ← PdfObject ← PdfDictionary

Implements​

IEnumerable<KeyValuePair<PdfName, PdfObject>>, IEnumerable

Inherited Members​

PdfObject.Resolve(), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Extension Methods​

PdfObjectExtensions.AsArray(PdfObject?), PdfObjectExtensions.AsBoolean(PdfObject?), PdfObjectExtensions.AsDictionary(PdfObject?), PdfObjectExtensions.AsInteger(PdfObject?), PdfObjectExtensions.AsName(PdfObject?), PdfObjectExtensions.AsNumber(PdfObject?), PdfObjectExtensions.AsStream(PdfObject?), PdfObjectExtensions.AsString(PdfObject?), PdfObjectExtensions.AsText(PdfObject?), PdfObjectExtensions.Get(PdfDictionary?, PdfName), PdfObjectExtensions.GetArray(PdfDictionary?, PdfName), PdfObjectExtensions.GetBoolean(PdfDictionary?, PdfName, bool), PdfObjectExtensions.GetDictionary(PdfDictionary?, PdfName), PdfObjectExtensions.GetInteger(PdfDictionary?, PdfName), PdfObjectExtensions.GetInteger(PdfDictionary?, PdfName, long), PdfObjectExtensions.GetName(PdfDictionary?, PdfName), PdfObjectExtensions.GetNumber(PdfDictionary?, PdfName), PdfObjectExtensions.GetNumber(PdfDictionary?, PdfName, double), PdfObjectExtensions.GetRaw(PdfDictionary?, PdfName), PdfObjectExtensions.GetStream(PdfDictionary?, PdfName), PdfObjectExtensions.GetText(PdfDictionary?, PdfName), PdfObjectExtensions.IsOfType(PdfDictionary?, PdfName), PdfObjectExtensions.Resolved(PdfObject?)

Constructors​

PdfDictionary()​

Initializes an empty dictionary.

public PdfDictionary()

PdfDictionary(int)​

Initializes an empty dictionary with room for capacity entries.

public PdfDictionary(int capacity)

Parameters​

capacity int

Properties​

Count​

Gets the number of entries.

public int Count { get; }

Property Value​

int

Keys​

Gets the keys of the dictionary.

public Dictionary<PdfName, PdfObject>.KeyCollection Keys { get; }

Property Value​

Dictionary<PdfName, PdfObject>.KeyCollection

this[PdfName]​

Gets or sets an entry, without resolving indirect references. Setting null removes the entry, which is how a PDF dictionary expresses absence.

public PdfObject? this[PdfName key] { get; set; }

Property Value​

PdfObject?

Methods​

ContainsKey(PdfName)​

Determines whether the dictionary contains key.

public bool ContainsKey(PdfName key)

Parameters​

key PdfName

Returns​

bool

GetEnumerator()​

Returns a non-allocating enumerator over the entries.

public Dictionary<PdfName, PdfObject>.Enumerator GetEnumerator()

Returns​

Dictionary<PdfName, PdfObject>.Enumerator

Remove(PdfName)​

Removes an entry.

public bool Remove(PdfName key)

Parameters​

key PdfName

Returns​

bool

Set(PdfName, PdfObject)​

Sets an entry.

public void Set(PdfName key, PdfObject value)

Parameters​

key PdfName

value PdfObject

ToString()​

Returns a string that represents the current object.

public override string ToString()

Returns​

string

A string that represents the current object.

TryGetValue(PdfName, out PdfObject)​

Tries to get an entry, without resolving indirect references.

public bool TryGetValue(PdfName key, out PdfObject value)

Parameters​

key PdfName

value PdfObject

Returns​

bool