Class Bookmark

All Implemented Interfaces:
Dimensions
Direct Known Subclasses:
IndexBookmark, LabelBookmark, SectionBookmark

public abstract class Bookmark extends NonDiscardableElement
Parent of all bookmark elements, which keep track of where certain items (like chapter titles and index entries) are.
  • Constructor Details

    • Bookmark

      public Bookmark()
  • Method Details

    • getWidth

      public long getWidth()
      Description copied from class: Element
      Return the width of the element.
      Specified by:
      getWidth in interface Dimensions
      Specified by:
      getWidth in class Element
    • getHeight

      public long getHeight()
      Description copied from class: Element
      Return the height (above the baseline) of the element.
      Specified by:
      getHeight in interface Dimensions
      Specified by:
      getHeight in class Element
    • getDepth

      public long getDepth()
      Description copied from class: Element
      Return the depth (below the baseline) of the element.
      Specified by:
      getDepth in interface Dimensions
      Specified by:
      getDepth in class Element
    • layOutHorizontally

      public long layOutHorizontally(long x, long y, org.apache.pdfbox.pdmodel.PDPageContentStream contents) throws IOException
      Description copied from class: Element
      Add the element to the contents as part of a horizontal sequence.
      Specified by:
      layOutHorizontally in class Element
      Parameters:
      x - the left-most point of the element.
      y - the baseline of the element.
      contents - the stream to add the element to.
      Returns:
      how much to move right afterward.
      Throws:
      IOException
    • layOutVertically

      public long layOutVertically(long x, long y, org.apache.pdfbox.pdmodel.PDPageContentStream contents) throws IOException
      Description copied from class: Element
      Add the element to the contents as part of a vertical sequence.
      Specified by:
      layOutVertically in class Element
      Parameters:
      x - the left-most point of the element.
      y - the upper-left point of the element.
      contents - the stream to add the element to.
      Returns:
      how much to move down afterward.
      Throws:
      IOException