PdfDictionary Class
A dictionary: entries whose keys are names (ISO 32000-2, 7.3.7). It keeps the order of its entries, and is mutable and not thread-safe.
public sealed class PdfDictionary : PdfObject, IEnumerable<KeyValuePair<PdfName, PdfObject>>, IEnumerableRemarks
The indexer gets the values as they are stored: a value may be a PdfReference. The Get* and TryGetResolved methods resolve them, and treat a null value as an absent entry, as the specification does.
- Inheritance
PdfObjectPdfDictionary- Implements
Constructors
| Name | Description |
|---|---|
| PdfDictionary() | Initializes a new instance of the PdfDictionary class. |
| PdfDictionary(int) | Initializes a new instance of the PdfDictionary class with a capacity. |
PdfDictionary overloads
PdfDictionary()
PdfDictionary.csInitializes a new instance of the PdfDictionary class.
public PdfDictionary()PdfDictionary(int)
PdfDictionary.csInitializes a new instance of the PdfDictionary class with a capacity.
public PdfDictionary(int capacity)Parameters
capacityint- The initial capacity.
Properties
| Name | Description |
|---|---|
| Count | Gets the number of entries. |
| Keys | Gets the keys, in the order of the entries. |
| Kind | Gets the kind of the object. |
Count
PdfDictionary.csKeys
PdfDictionary.csKind
PdfDictionary.csIndexers
| Name | Description |
|---|---|
| this[PdfName] | Gets or sets the value of an entry, as it is stored: it may be a PdfReference. |
this[PdfName]
PdfDictionary.csGets or sets the value of an entry, as it is stored: it may be a PdfReference.
Methods
| Name | Description |
|---|---|
| Clear() | Removes every entry. |
| CloneShallow() | Copies the entries of the dictionary to a new dictionary. The values are not copied. |
| ContainsKey(PdfName) | Indicates whether the dictionary has an entry. |
| Get<T>(PdfName) | Gets the resolved value of an entry when it has a type. |
| GetBoolean(PdfName, bool) | Gets the value of an entry as a boolean. |
| GetEnumerator() | Returns an enumerator over the entries, whose values are not resolved. |
| GetInteger(PdfName, long) | Gets the value of an entry as an integer. A real number is truncated. |
| GetName(PdfName) | Gets the value of an entry as a name. |
| GetNumber(PdfName, double) | Gets the value of an entry as a number. |
| GetResolved(PdfName) | Gets the value of an entry, resolving it when it is a reference. |
| GetText(PdfName) | Gets the value of an entry as a text string (ISO 32000-2, 7.9.2.2). |
| IsType(PdfName) | Indicates whether the value of the /Type entry is a name. |
| Remove(PdfName) | Removes an entry. |
| SetName(PdfName, string) | Sets an entry to a name. |
| SetNumber(PdfName, double) | Sets an entry to a number: an integer when the value is a whole number, a real number otherwise. |
| SetText(PdfName, string?) | Sets an entry to a text string (ISO 32000-2, 7.9.2.2), or removes it when the text is null. |
| System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<Meziantou.Framework.Pdf.Objects.PdfName,Meziantou.Framework.Pdf.Objects.PdfObject>>.GetEnumerator() | |
| System.Collections.IEnumerable.GetEnumerator() | |
| TryGetResolved<T>(PdfName, T?) | Gets the value of an entry, resolved, when it has a type. |
Clear()
PdfDictionary.csRemoves every entry.
public void Clear()CloneShallow()
PdfDictionary.csCopies the entries of the dictionary to a new dictionary. The values are not copied.
public PdfDictionary CloneShallow()Returns
PdfDictionary The copy.
ContainsKey(PdfName)
PdfDictionary.csGet<T>(PdfName)
PdfDictionary.csGetBoolean(PdfName, bool)
PdfDictionary.csGetEnumerator()
PdfDictionary.csReturns an enumerator over the entries, whose values are not resolved.
public OrderedDictionary<PdfName, PdfObject>.Enumerator GetEnumerator()Returns
OrderedDictionary<PdfName, PdfObject>.Enumerator The enumerator.
GetInteger(PdfName, long)
PdfDictionary.csGetName(PdfName)
PdfDictionary.csGetNumber(PdfName, double)
PdfDictionary.csGetResolved(PdfName)
PdfDictionary.csGets the value of an entry, resolving it when it is a reference.
Parameters
keyPdfName- The key.
Returns
PdfObject? The value, or null when there is no entry, when the value is null, or when it is a reference to an object that does not exist.
GetText(PdfName)
PdfDictionary.csIsType(PdfName)
PdfDictionary.csRemove(PdfName)
PdfDictionary.csSetName(PdfName, string)
PdfDictionary.csSetNumber(PdfName, double)
PdfDictionary.csSetText(PdfName, string?)
PdfDictionary.csSystem.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<Meziantou.Framework.Pdf.Objects.PdfName,Meziantou.Framework.Pdf.Objects.PdfObject>>.GetEnumerator()
PdfDictionary.csIEnumerator<KeyValuePair<PdfName, PdfObject>> IEnumerable<KeyValuePair<PdfName, PdfObject>>.GetEnumerator()No documentation is available.