Table of Contents

Class PdfDictionary

Namespace
PdfSharp.Pdf
Assembly
PdfSharp.dll

Represents a PDF dictionary object.

public class PdfDictionary : PdfObject, ICloneable, IEnumerable<KeyValuePair<string, PdfItem?>>, IEnumerable
Inheritance
PdfDictionary
Implements
Derived
Inherited Members

Constructors

PdfDictionary()

Initializes a new instance of the PdfDictionary class.

public PdfDictionary()

PdfDictionary(PdfDictionary)

Initializes a new instance from an existing dictionary. Used for object type transformation.

protected PdfDictionary(PdfDictionary dict)

Parameters

dict PdfDictionary

PdfDictionary(PdfDocument)

Initializes a new instance of the PdfDictionary class.

public PdfDictionary(PdfDocument document)

Parameters

document PdfDocument

The document.

Properties

Elements

Gets the dictionary containing the elements of this dictionary.

public PdfDictionary.DictionaryElements Elements { get; }

Property Value

PdfDictionary.DictionaryElements

Stream

Gets or sets the PDF stream belonging to this dictionary. Returns null if the dictionary has no stream. To create the stream, call the CreateStream function.

public PdfDictionary.PdfStream Stream { get; set; }

Property Value

PdfDictionary.PdfStream

Methods

Clone()

Creates a copy of this dictionary. Direct values are deep copied. Indirect references are not modified.

public PdfDictionary Clone()

Returns

PdfDictionary

Copy()

This function is useful for importing objects from external documents. The returned object is not yet complete. irefs refer to external objects and directed objects are cloned but their document property is null. A cloned dictionary or array needs a 'fix-up' to be a valid object.

protected override object Copy()

Returns

object

CreateStream(byte[])

Creates the stream of this dictionary and initializes it with the specified byte array. The function must not be called if the dictionary already has a stream.

public PdfDictionary.PdfStream CreateStream(byte[] value)

Parameters

value byte[]

Returns

PdfDictionary.PdfStream

GetEnumerator()

Returns an enumerator that iterates through the dictionary elements.

public IEnumerator<KeyValuePair<string, PdfItem?>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<string, PdfItem>>

ToString()

Returns a string with the content of this object in a readable form. Useful for debugging purposes only.

public override string ToString()

Returns

string