org.pdfbox.util
Class PDFHighlighter

java.lang.Object
  extended byorg.pdfbox.util.PDFStreamEngine
      extended byorg.pdfbox.util.PDFTextStripper
          extended byorg.pdfbox.util.PDFHighlighter

public class PDFHighlighter
extends PDFTextStripper

Highlighting of words in a PDF document with an XML file.

Version:
$Revision: 1.6 $
Author:
slagraulet (slagraulet@cardiweb.com), Ben Litchfield (ben@csh.rit.edu)
See Also:
Adobe Highlight File Format

Constructor Summary
PDFHighlighter()
          Default constructor.
 
Method Summary
 void generateXMLHighlight(PDDocument pdDocument, String[] sWords, Writer xmlOutput)
          Generate an XML highlight string based on the PDF.
 void generateXMLHighlight(PDDocument pdDocument, String highlightWord, Writer xmlOutput)
          Generate an XML highlight string based on the PDF.
static void main(String[] args)
          Command line application.
 
Methods inherited from class org.pdfbox.util.PDFTextStripper
getEndBookmark, getEndPage, getLineSeparator, getPageSeparator, getStartBookmark, getStartPage, getText, getText, getText, getWordSeparator, setEndBookmark, setEndPage, setFirstPageRotation, setGetFirstPageRotationFromThis, setLineSeparator, setPageSeparator, setShouldSeparateByBeads, setSortByPosition, setStartBookmark, setStartPage, setSuppressDuplicateOverlappingText, setWordSeparator, shouldSeparateByBeads, shouldSortByPosition, shouldSuppressDuplicateOverlappingText, writeText, writeText
 
Methods inherited from class org.pdfbox.util.PDFStreamEngine
getColorSpaces, getCurrentPage, getFonts, getGraphicsStack, getGraphicsState, getGraphicsStates, getResources, getTextLineMatrix, getTextMatrix, getXObjects, processOperator, processStream, processSubStream, setColorSpaces, setFonts, setGraphicsStack, setGraphicsState, setGraphicsStates, setTextLineMatrix, setTextMatrix, showString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDFHighlighter

public PDFHighlighter()
               throws IOException
Default constructor.

Throws:
IOException - If there is an error constructing this class.
Method Detail

generateXMLHighlight

public void generateXMLHighlight(PDDocument pdDocument,
                                 String highlightWord,
                                 Writer xmlOutput)
                          throws 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:
IOException - If there is an error reading from the PDF, or writing to the XML.

generateXMLHighlight

public void generateXMLHighlight(PDDocument pdDocument,
                                 String[] sWords,
                                 Writer xmlOutput)
                          throws 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:
IOException - If there is an error reading from the PDF, or writing to the XML.

main

public static void main(String[] args)
                 throws IOException
Command line application.

Parameters:
args - The command line arguments to the application.
Throws:
IOException - If there is an error generating the highlight file.


Copyright null EGIZ - E-Government Innovation Center. All Rights Reserved.