Save This Page
Home » iText-2.1.7 » com.lowagie » text » pdf » [javadoc | source]
com.lowagie.text.pdf
public class: PdfDictionary [javadoc | source]
java.lang.Object
   com.lowagie.text.pdf.PdfObject
      com.lowagie.text.pdf.PdfDictionary
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.7' section 3.2.6 (page 59-60).

Field Summary
public static final  PdfName FONT    This is a possible type of dictionary 
public static final  PdfName OUTLINES    This is a possible type of dictionary 
public static final  PdfName PAGE    This is a possible type of dictionary 
public static final  PdfName PAGES    This is a possible type of dictionary 
public static final  PdfName CATALOG    This is a possible type of dictionary 
protected  HashMap hashMap    This is the hashmap that contains all the values and keys of the dictionary 
Fields inherited from com.lowagie.text.pdf.PdfObject:
BOOLEAN,  NUMBER,  STRING,  NAME,  ARRAY,  DICTIONARY,  STREAM,  NULL,  INDIRECT,  NOTHING,  TEXT_PDFDOCENCODING,  TEXT_UNICODE,  bytes,  type,  indRef
Constructor:
 public PdfDictionary() 
 public PdfDictionary(PdfName type) 
    Constructs a PdfDictionary-object of a certain type.
    Parameters:
    type - a PdfName
Method from com.lowagie.text.pdf.PdfDictionary Summary:
contains,   get,   getAsArray,   getAsBoolean,   getAsDict,   getAsIndirectObject,   getAsName,   getAsNumber,   getAsStream,   getAsString,   getDirectObject,   getKeys,   isCatalog,   isFont,   isOutlineTree,   isPage,   isPages,   merge,   mergeDifferent,   put,   putAll,   putEx,   remove,   size,   toPdf,   toString
Methods from com.lowagie.text.pdf.PdfObject:
canBeInObjStm,   getBytes,   getIndRef,   isArray,   isBoolean,   isDictionary,   isIndirect,   isName,   isNull,   isNumber,   isStream,   isString,   length,   setContent,   setIndRef,   toPdf,   toString,   type
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.lowagie.text.pdf.PdfDictionary Detail:
 public boolean contains(PdfName key) 
    Returns true if this PdfDictionary contains a mapping for the specified key.
 public PdfObject get(PdfName key) 
    Returns the PdfObject associated to the specified key.
 public PdfArray getAsArray(PdfName key) 
    Returns a PdfObject as a PdfArray, resolving indirect references. The object associated with the PdfName given is retrieved and resolved to a direct object. If it is a PdfArray, it is cast down and returned as such. Otherwise null is returned.
 public PdfBoolean getAsBoolean(PdfName key) 
    Returns a PdfObject as a PdfBoolean, resolving indirect references. The object associated with the PdfName given is retrieved and resolved to a direct object. If it is a PdfBoolean, it is cast down and returned as such. Otherwise null is returned.
 public PdfDictionary getAsDict(PdfName key) 
    Returns a PdfObject as a PdfDictionary, resolving indirect references. The object associated with the PdfName given is retrieved and resolved to a direct object. If it is a PdfDictionary, it is cast down and returned as such. Otherwise null is returned.
 public PdfIndirectReference getAsIndirectObject(PdfName key) 
    Returns a PdfObject as a PdfIndirectReference. The object associated with the PdfName given is retrieved If it is a PdfIndirectReference, it is cast down and returned as such. Otherwise null is returned.
 public PdfName getAsName(PdfName key) 
    Returns a PdfObject as a PdfName, resolving indirect references. The object associated with the PdfName given is retrieved and resolved to a direct object. If it is a PdfName, it is cast down and returned as such. Otherwise null is returned.
 public PdfNumber getAsNumber(PdfName key) 
    Returns a PdfObject as a PdfNumber, resolving indirect references. The object associated with the PdfName given is retrieved and resolved to a direct object. If it is a PdfNumber, it is cast down and returned as such. Otherwise null is returned.
 public PdfStream getAsStream(PdfName key) 
    Returns a PdfObject as a PdfStream, resolving indirect references. The object associated with the PdfName given is retrieved and resolved to a direct object. If it is a PdfStream, it is cast down and returned as such. Otherwise null is returned.
 public PdfString getAsString(PdfName key) 
    Returns a PdfObject as a PdfString, resolving indirect references. The object associated with the PdfName given is retrieved and resolved to a direct object. If it is a PdfString, it is cast down and returned as such. Otherwise null is returned.
 public PdfObject getDirectObject(PdfName key) 
    Returns the PdfObject associated to the specified key, resolving a possible indirect reference to a direct object. This method will never return a PdfIndirectReference object.
 public Set getKeys() 
    Get all keys that are set.
 public boolean isCatalog() 
    Checks if a Dictionary is of the type CATALOG.
 public boolean isFont() 
    Checks if a Dictionary is of the type FONT.
 public boolean isOutlineTree() 
    Checks if a Dictionary is of the type OUTLINES.
 public boolean isPage() 
    Checks if a Dictionary is of the type PAGE.
 public boolean isPages() 
    Checks if a Dictionary is of the type PAGES.
 public  void merge(PdfDictionary other) 
 public  void mergeDifferent(PdfDictionary other) 
 public  void put(PdfName key,
    PdfObject object) 
    Associates the specified PdfObject as value with the specified PdfName as key in this map. If the map previously contained a mapping for this key, the old value is replaced. If the value is null or PdfNull the key is deleted.
 public  void putAll(PdfDictionary dic) 
    Copies all of the mappings from the specified PdfDictionary to this PdfDictionary. These mappings will replace any mappings previously contained in this PdfDictionary.
 public  void putEx(PdfName key,
    PdfObject value) 
    Associates the specified PdfObject as value to the specified PdfName as key in this map. If the value is a PdfNull, it is treated just as any other PdfObject. If the value is null however nothing is done.
 public  void remove(PdfName key) 
    Removes a PdfObject and its key from the PdfDictionary.
 public int size() 
    Returns the number of key-value mappings in this PdfDictionary.
 public  void toPdf(PdfWriter writer,
    OutputStream os) throws IOException 
    Writes the PDF representation of this PdfDictionary as an array of byte to the given OutputStream.
 public String toString() 
    Returns a string representation of this PdfDictionary. The string doesn't contain any of the content of this dictionary. Rather the string "dictionary" is returned, possibly followed by the type of this PdfDictionary, if set.