Class PrintBookmarks


  • public class PrintBookmarks
    extends java.lang.Object
    This is an example on how to access the bookmarks that are part of a pdf document.
    • Constructor Summary

      Constructors 
      Constructor Description
      PrintBookmarks()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)
      This will print the documents data.
      void printBookmark​(PDDocument document, PDOutlineNode bookmark, java.lang.String indentation)
      This will print the documents bookmarks to System.out.
      private static void usage()
      This will print the usage for this document.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PrintBookmarks

        public PrintBookmarks()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        This will print the documents data.
        Parameters:
        args - The command line arguments.
        Throws:
        java.io.IOException - If there is an error parsing the document.
      • usage

        private static void usage()
        This will print the usage for this document.
      • printBookmark

        public void printBookmark​(PDDocument document,
                                  PDOutlineNode bookmark,
                                  java.lang.String indentation)
                           throws java.io.IOException
        This will print the documents bookmarks to System.out.
        Parameters:
        document - The document.
        bookmark - The bookmark to print out.
        indentation - A pretty printing parameter
        Throws:
        java.io.IOException - If there is an error getting the page count.