Class Bookmark

java.lang.Object
org.jpedal.constants.Bookmark

public class Bookmark extends Object
Represents a bookmark (outline) item for a document.
  • Constructor Details

    • Bookmark

      public Bookmark(String title, int pageNumber)
      Create a new bookmark (outline).

      To create the root bookmark, use Bookmarks()

      Parameters:
      title - the displayable title of the bookmark
      pageNumber - the page that the bookmark will navigate to
  • Method Details

    • getTitle

      public String getTitle()
      Returns the displayable title of the bookmark.
      Returns:
      the displayable title of the bookmark
    • setTitle

      public Bookmark setTitle(String title)
      Set the displayable title of the bookmark.
      Parameters:
      title - the title
    • getPageNumber

      public int getPageNumber()
      Returns the page that the bookmark will navigate to.
      Returns:
      the page that the bookmark will navigate to
    • setPageNumber

      public Bookmark setPageNumber(int pageNumber)
      Set the page that the bookmark will navigate to.
      Parameters:
      pageNumber - the page number
    • getChildren

      public List<Bookmark> getChildren()
      Returns the list of child bookmarks.
      Returns:
      the list of child bookmarks
    • addChild

      public Bookmark addChild(Bookmark child)
      Add a new child bookmark.
      Parameters:
      child - the bookmark to add
      Returns:
      a reference to the added child
    • addChild

      public Bookmark addChild(String title, int pageNumber)
      Add a new child bookmark.
      Parameters:
      title - the title
      pageNumber - the page number
      Returns:
      a reference to the added child