Class HtmlBookmarks

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.util.EventListener

    public class HtmlBookmarks
    extends AbstractTool
    Allows you to generate an index file in HTML containing Bookmarks to an existing PDF file.
    Since:
    2.1.1 (imported from itexttoolbox project)
    • Constructor Detail

      • HtmlBookmarks

        public HtmlBookmarks()
        Constructs an HtmlBookmarks object.
    • Method Detail

      • addBookmark

        private static void addBookmark​(java.lang.String pdf,
                                        Section section,
                                        java.util.Map<java.lang.String,​java.lang.Object> bookmark)
        Recursive method to write Bookmark titles to the System.out.
        Parameters:
        pdf - the path to the PDF file
        section - the section to which the bookmarks should be added
        bookmark - a Map containing a Bookmark (and possible kids)
      • createBookmark

        private static Section createBookmark​(java.lang.String pdf,
                                              Section section,
                                              java.util.Map<java.lang.String,​java.lang.Object> bookmark)
        Adds a line with the title and an anchor.
        Parameters:
        pdf - the link to the PDF file
        section - the section that gets the line
        bookmark - the bookmark that has the data for the line
        Returns:
        a subsection of section
      • main

        public static void main​(java.lang.String[] args)
        Allows you to generate an index file in HTML containing Bookmarks to an existing PDF file.
        Parameters:
        args - String[]
      • getDestPathPDF

        protected java.io.File getDestPathPDF()
                                       throws java.lang.InstantiationException
        Description copied from class: AbstractTool
        Gets the PDF file that should be generated (or null if the output isn't a PDF file).
        Specified by:
        getDestPathPDF in class AbstractTool
        Returns:
        File
        Throws:
        java.lang.InstantiationException - on error
        See Also:
        AbstractTool.getDestPathPDF()