PdfDictionary class
Namespace: PdfNetStack.Objects
Assembly: PdfNetStack.dll
Package: PdfNetStack
A PDF dictionary with keys in insertion order. Keys are names without the leading slash. Most PDF dictionaries hold a handful of keys, so lookups are linear until the dictionary grows, then switch to a hash index.
public sealed class PdfDictionary : PdfObject, IEnumerable<KeyValuePair<string, PdfObject>>, IEnumerableInheritance
object ← PdfObject ← PdfDictionary
Implements
IEnumerable<KeyValuePair<string, PdfObject>>, IEnumerable
Constructors
Section titled “Constructors”PdfDictionary()
Section titled “ PdfDictionary()”Creates an empty dictionary.
public PdfDictionary()Properties
Section titled “Properties”Number of entries.
public int Count { get; }Property Value
Section titled “Property Value”The keys, in insertion order.
public IReadOnlyList<string> Keys { get; }Property Value
Section titled “Property Value”this[string]
Section titled “ this[string]”The value for key, or null when absent. The value may be a reference;
resolve it through the document. Setting null removes the entry.
public PdfObject? this[string key] { get; set; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”ContainsKey(string)
Section titled “ ContainsKey(string)”True when the key is present.
public bool ContainsKey(string key)Parameters
Section titled “Parameters”key string
Returns
Section titled “Returns”GetEnumerator()
Section titled “ GetEnumerator()”Returns an enumerator that iterates through the collection.
public IEnumerator<KeyValuePair<string, PdfObject>> GetEnumerator()Returns
Section titled “Returns”IEnumerator<KeyValuePair<string, PdfObject>>
An enumerator that can be used to iterate through the collection.
GetName(string)
Section titled “ GetName(string)”The value of key when it is a direct name, without the slash.
public string? GetName(string key)Parameters
Section titled “Parameters”key string
Returns
Section titled “Returns”Remove(string)
Section titled “ Remove(string)”Removes an entry; returns false when it was absent.
public bool Remove(string key)Parameters
Section titled “Parameters”key string
Returns
Section titled “Returns”Set(string, PdfObject)
Section titled “ Set(string, PdfObject)”Adds or replaces an entry. Replacing keeps the key’s position.
public void Set(string key, PdfObject value)Parameters
Section titled “Parameters”key string
value PdfObject
TryGetValue(string, out PdfObject)
Section titled “ TryGetValue(string, out PdfObject)”Gets the value for key when present.
public bool TryGetValue(string key, out PdfObject value)Parameters
Section titled “Parameters”key string
value PdfObject