Class PDFOutline

  • All Implemented Interfaces:
    PDFWritable

    public class PDFOutline
    extends PDFObject

    This represents a single Outline object in a PDF, including the root Outlines object. Outlines provide the bookmark bar, usually rendered to the right of a PDF document in user agents such as Acrobat Reader.

    This work was authored by Kelly A. Campbell.

    • Field Detail

      • subentries

        private java.util.List subentries
        list of sub-entries (outline objects)
      • parent

        private PDFOutline parent
        parent outline object. Root Outlines parent is null
      • count

        private int count
      • openItem

        private boolean openItem
      • title

        private java.lang.String title
        title to display for the bookmark entry
    • Constructor Detail

      • PDFOutline

        public PDFOutline​(java.lang.String title,
                          PDFReference action,
                          boolean openItem)
        Create a PDF outline with the title and action.
        Parameters:
        title - the title of the outline entry (can only be null for root Outlines obj)
        action - the action for this outline
        openItem - indicator of whether child items are visible or not
    • Method Detail

      • setTitle

        public void setTitle​(java.lang.String t)
        Set the title of this Outline object.
        Parameters:
        t - the title of the outline
      • addOutline

        public void addOutline​(PDFOutline outline)
        Add a sub element to this outline.
        Parameters:
        outline - a sub outline
      • incrementCount

        private void incrementCount()
        Increment the number of subentries and descendants.
      • toPDF

        protected byte[] toPDF()
        Encodes the object as a byte array for output to a PDF file.
        Overrides:
        toPDF in class PDFObject
        Returns:
        PDF string