Class PDFHighlighter

    • Constructor Detail

      • PDFHighlighter

        public PDFHighlighter()
                       throws java.io.IOException
        Default constructor.
        Throws:
        java.io.IOException - If there is an error constructing this class.
    • Method Detail

      • generateXMLHighlight

        public void generateXMLHighlight​(PDDocument pdDocument,
                                         java.lang.String highlightWord,
                                         java.io.Writer xmlOutput)
                                  throws java.io.IOException
        Generate an XML highlight string based on the PDF.
        Parameters:
        pdDocument - The PDF to find words in.
        highlightWord - The word to search for.
        xmlOutput - The resulting output xml file.
        Throws:
        java.io.IOException - If there is an error reading from the PDF, or writing to the XML.
      • generateXMLHighlight

        public void generateXMLHighlight​(PDDocument pdDocument,
                                         java.lang.String[] sWords,
                                         java.io.Writer xmlOutput)
                                  throws java.io.IOException
        Generate an XML highlight string based on the PDF.
        Parameters:
        pdDocument - The PDF to find words in.
        sWords - The words to search for.
        xmlOutput - The resulting output xml file.
        Throws:
        java.io.IOException - If there is an error reading from the PDF, or writing to the XML.
      • endPage

        protected void endPage​(PDPage pdPage)
                        throws java.io.IOException
        End a page. Default implementation is to do nothing. Subclasses may provide additional information.
        Overrides:
        endPage in class PDFTextStripper
        Parameters:
        pdPage - The page we are about to process.
        Throws:
        java.io.IOException - If there is any error writing to the stream.
      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        Command line application.
        Parameters:
        args - The command line arguments to the application.
        Throws:
        java.io.IOException - If there is an error generating the highlight file.