com.adobe.acrobat
Class PDFBookmark

java.lang.Object
  |
  +--com.adobe.acrobat.PDFBookmark

public class PDFBookmark
extends java.lang.Object

A PDFBookmark corresponds to the PDF Outline (also called bookmark) structure. A bookmark allows a user to access views of a document by name. The activation of a bookmark typically brings up a new view. But it could also includes any PDF actions (e.g., play a sound - not yet supported in the Java version).

See Also:
Viewer.getRootBookmark()

Method Summary
 java.util.Vector getBookmarks()
          Returns a vector of the descendants of this bookmark.
 java.lang.String getTitle()
          Returns the title of the bookmark.
 boolean isLeaf()
          Tests if the bookmark is a leaf node, i.e., has no descendants.
 boolean isOpen()
          Tests if the bookmark should be initially displayed with all of its descendants showing or not.
 boolean isRoot()
          Tests if the bookmark is the root bookmark.
 void performAction(Viewer viewer)
          Activates the bookmark, i.e., the PDF action (or PDF destination) associated with this bookmark is activated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTitle

public java.lang.String getTitle()
                          throws java.lang.Exception
Returns the title of the bookmark.
Returns:
the title of the bookmark
Throws:
java.lang.Exception - if there is an error

isRoot

public boolean isRoot()
               throws java.lang.Exception
Tests if the bookmark is the root bookmark. A root bookmark is usually not displayed, since it has no associated title. The descendants of the root bookmark are initial set of bookmarks that should be displayed.
Returns:
true if this is the root bookmark
Throws:
java.lang.Exception - if there is an error

isOpen

public boolean isOpen()
               throws java.lang.Exception
Tests if the bookmark should be initially displayed with all of its descendants showing or not.
Returns:
true if this bookmark is "open"
Throws:
java.lang.Exception - if there is an error

isLeaf

public boolean isLeaf()
               throws java.lang.Exception
Tests if the bookmark is a leaf node, i.e., has no descendants.
Returns:
true if this bookmark is a leaf node
Throws:
java.lang.Exception - if there is an error

performAction

public void performAction(Viewer viewer)
                   throws java.lang.Exception
Activates the bookmark, i.e., the PDF action (or PDF destination) associated with this bookmark is activated. Typically this result in a destination page getting displayed.
Parameters:
viewer - The viewer in which to display the results of the action. Note that the PDF document associated with the viewer must be the same as the one associated with this bookmark.
Throws:
java.lang.Exception - Throws an exception if action cannot be performed.

getBookmarks

public java.util.Vector getBookmarks()
                              throws java.lang.Exception
Returns a vector of the descendants of this bookmark. If the bookmark has no descendants, then it returns null.
Throws:
java.lang.Exception - Throws an exception if the set of descendents cannot be determined.