org.icepdf.core.pobjects
Class Catalog

java.lang.Object
  extended by org.icepdf.core.pobjects.Dictionary
      extended by org.icepdf.core.pobjects.Catalog

public class Catalog
extends Dictionary

The Catalog object represents the root of a PDF document's object heirarchy. The Catalog is located by means of the Root entry in the trailer of the PDF file. The catalog contains references to other objects defining the document's contents, outline, names, destinations, and other attributes.

The Catalog class can be accessed from the Document class for convenience, but can also be accessed via the PTrailer class. Useful information about the document can be extracted from the Catalog Dictionary, such as PDF version information and Viewer Preferences. All Catalog dictionary properties can be accesed via the getEntries method. See section 3.6.1 of the PDF Reference version 1.6 for more information on the properties available in the Catalog Object.

Since:
1.0

Field Summary
 
Fields inherited from class org.icepdf.core.pobjects.Dictionary
entries, inited, isDeleted, isNew, library, SUBTYPE_KEY, TYPE_KEY
 
Constructor Summary
Catalog(Library l, java.util.Hashtable h)
          Creates a new instance of a Catalog.
 
Method Summary
 void dispose(boolean cache)
          Dispose the Catalog.
 Dictionary getDestinations()
          Gets a dictionary of names and corresponding destinations.
 NameTree getNameTree()
          Gets the document's Names dictionary.
 Outlines getOutlines()
          Gets the Outlines Dictionary that is the root of the document's outline hierarchy.
 PageTree getPageTree()
          Gets PageTree node that is the root of the document's page tree.
 ViewerPreferences getViewerPreferences()
          Gets a dictionary of keys and corresponding viewer preferences This can be used to pull information based on the PDF specification, such as HideToolbar or FitWindow
 void init()
          Initiate the PageTree.
 java.lang.String toString()
          Returns a summary of the Catalog dictionary values.
 
Methods inherited from class org.icepdf.core.pobjects.Dictionary
getEntries, getFloat, getInt, getLibrary, getNumber, getObject, getObject, getPObjectReference, isDeleted, isNew, setDeleted, setNew, setPObjectReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Catalog

public Catalog(Library l,
               java.util.Hashtable h)
Creates a new instance of a Catalog.

Parameters:
l - document library.
h - Catalog dictionary entries.
Method Detail

init

public void init()
Initiate the PageTree.

Overrides:
init in class Dictionary

dispose

public void dispose(boolean cache)
Dispose the Catalog.

Parameters:
cache - if true, cached files are removed, otherwise objects are freed but object caches are left intact.

getPageTree

public PageTree getPageTree()
Gets PageTree node that is the root of the document's page tree. The PageTree can be traversed to access child PageTree and Page objects.

Returns:
Catalogs PageTree.
See Also:
Page

getOutlines

public Outlines getOutlines()
Gets the Outlines Dictionary that is the root of the document's outline hierarchy. The Outline can be traversed to access child OutlineItems.

Returns:
Outlines object if one exists; null, otherwise.
See Also:
OutlineItem

getNameTree

public NameTree getNameTree()
Gets the document's Names dictionary. The Names dictionary contains a category of objects in a PDF file which can be referred to by name rather than by object reference.

Returns:
name dictionary for document. If no name dictionary exists null is returned.

getDestinations

public Dictionary getDestinations()
Gets a dictionary of names and corresponding destinations.

Returns:
A Dictionary of Destinations; if none, null is returned.

getViewerPreferences

public ViewerPreferences getViewerPreferences()
Gets a dictionary of keys and corresponding viewer preferences This can be used to pull information based on the PDF specification, such as HideToolbar or FitWindow

Returns:
the constructed ViewerPreferences object

toString

public java.lang.String toString()
Returns a summary of the Catalog dictionary values.

Overrides:
toString in class Dictionary
Returns:
dictionary values.