Table of Contents

Class PdfDictionary

Namespace
iTextSharp.text.pdf
Assembly
iTextSharp.LGPLv2.Core.dll

PdfDictionary is the Pdf dictionary object. A dictionary is an associative table containing pairs of objects. The first element of each pair is called the key and the second element is called the value. Unlike dictionaries in the PostScript language, a key must be a PdfName . A value can be any kind of PdfObject , including a dictionary. A dictionary is generally used to collect and tie together the attributes of a complex object, with each key-value pair specifying the name and value of an attribute. A dictionary is represented by two left angle brackets , followed by a sequence of key-value pairs, followed by two right angle brackets. This object is described in the 'Portable Document Format Reference Manual version 1.3' section 4.7 (page 40-41). @see PdfObject @see PdfName @see BadPdfFormatException

public class PdfDictionary : PdfObject
Inheritance
PdfDictionary
Derived
Inherited Members

Constructors

PdfDictionary()

constructors

public PdfDictionary()

PdfDictionary(PdfName)

Constructs a PdfDictionary -object of a certain type.

public PdfDictionary(PdfName type)

Parameters

type PdfName

a PdfName

Fields

Catalog

static membervariables (types of dictionary's)

public static PdfName Catalog

Field Value

PdfName

Font

This is a possible type of dictionary

public static PdfName Font

Field Value

PdfName

HashMap

membervariables

protected INullValueDictionary<PdfName, PdfObject> HashMap

Field Value

INullValueDictionary<PdfName, PdfObject>

Outlines

This is a possible type of dictionary

public static PdfName Outlines

Field Value

PdfName

Page

This is a possible type of dictionary

public static PdfName Page

Field Value

PdfName

Pages

This is a possible type of dictionary

public static PdfName Pages

Field Value

PdfName

Properties

Keys

methods overriding some methods in PdfObject

public ICollection<PdfName> Keys { get; }

Property Value

ICollection<PdfName>

Size

public int Size { get; }

Property Value

int

Methods

Contains(PdfName)

public bool Contains(PdfName key)

Parameters

key PdfName

Returns

bool

Get(PdfName)

public PdfObject Get(PdfName key)

Parameters

key PdfName

Returns

PdfObject

GetAsArray(PdfName)

public PdfArray GetAsArray(PdfName key)

Parameters

key PdfName

Returns

PdfArray

GetAsBoolean(PdfName)

public PdfBoolean GetAsBoolean(PdfName key)

Parameters

key PdfName

Returns

PdfBoolean

GetAsDict(PdfName)

All the getAs functions will return either null, or the specified object type This function will automatically look up indirect references. There's one obvious exception, the one that will only return an indirect reference. All direct objects come back as a null. Mark A Storer (2/17/06)

public PdfDictionary GetAsDict(PdfName key)

Parameters

key PdfName

Returns

PdfDictionary

the appropriate object in its final type, or null

GetAsIndirectObject(PdfName)

public PdfIndirectReference GetAsIndirectObject(PdfName key)

Parameters

key PdfName

Returns

PdfIndirectReference

GetAsName(PdfName)

public PdfName GetAsName(PdfName key)

Parameters

key PdfName

Returns

PdfName

GetAsNumber(PdfName)

public PdfNumber GetAsNumber(PdfName key)

Parameters

key PdfName

Returns

PdfNumber

GetAsStream(PdfName)

public PdfStream GetAsStream(PdfName key)

Parameters

key PdfName

Returns

PdfStream

GetAsString(PdfName)

public PdfString GetAsString(PdfName key)

Parameters

key PdfName

Returns

PdfString

GetDirectObject(PdfName)

This function behaves the same as 'get', but will never return an indirect reference, it will always look such references up and return the actual object.

public PdfObject GetDirectObject(PdfName key)

Parameters

key PdfName

Returns

PdfObject

null, or a non-indirect object

GetEnumerator()

public virtual IEnumerator<KeyValuePair<PdfName, PdfObject>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<PdfName, PdfObject>>

IsCatalog()

public bool IsCatalog()

Returns

bool

IsFont()

public bool IsFont()

Returns

bool

IsOutlineTree()

public bool IsOutlineTree()

Returns

bool

IsPage()

public bool IsPage()

Returns

bool

IsPages()

public bool IsPages()

Returns

bool

Merge(PdfDictionary)

Checks if a Dictionary is of the type FONT.

public void Merge(PdfDictionary other)

Parameters

other PdfDictionary

MergeDifferent(PdfDictionary)

methods concerning the type of Dictionary

public void MergeDifferent(PdfDictionary other)

Parameters

other PdfDictionary

Put(PdfName, PdfObject)

public void Put(PdfName key, PdfObject value)

Parameters

key PdfName
value PdfObject

PutEx(PdfName, PdfObject)

Adds a PdfObject and its key to the PdfDictionary . If the value is null it does nothing.

public void PutEx(PdfName key, PdfObject value)

Parameters

key PdfName

key of the entry (a PdfName )

value PdfObject

value of the entry (a PdfObject )

Remove(PdfName)

public void Remove(PdfName key)

Parameters

key PdfName

ToPdf(PdfWriter, Stream)

Returns the PDF representation of this PdfDictionary .

public override void ToPdf(PdfWriter writer, Stream os)

Parameters

writer PdfWriter
os Stream

ToString()

public override string ToString()

Returns

string