|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pdfbox.util.PDFStreamEngine
org.pdfbox.util.PDFTextStripper
org.pdfbox.util.PDFHighlighter
Highlighting of words in a PDF document with an XML file.
Field Summary |
Fields inherited from class org.pdfbox.util.PDFTextStripper |
output |
Constructor Summary | |
PDFHighlighter()
Default constructor. |
Method Summary | |
protected void |
endPage(PDPage pdPage)
End a page. |
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. |
Color |
getHighlightColor()
Get the color to highlight the strings with. |
String |
getHighlightColorAsString()
Get the highlight color as an HTML like string. |
static void |
main(String[] args)
Command line application. |
void |
setHighlightColor(Color color)
Get the color to highlight the strings with. |
void |
setHighlightColor(String color)
Set the highlight color using HTML like rgb string. |
Methods inherited from class org.pdfbox.util.PDFStreamEngine |
getColorSpaces, getFonts, getGraphicsStack, getGraphicsState, getGraphicsStates, getResources, getTextLineMatrix, getTextMatrix, processOperator, processOperator, processStream, processSubStream, setColorSpaces, setFonts, setGraphicsStack, setGraphicsState, setGraphicsStates, setTextLineMatrix, setTextMatrix, showString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PDFHighlighter() throws IOException
IOException
- If there is an error constructing this class.Method Detail |
public void generateXMLHighlight(PDDocument pdDocument, String highlightWord, Writer xmlOutput) throws IOException
pdDocument
- The PDF to find words in.highlightWord
- The word to search for.xmlOutput
- The resulting output xml file.
IOException
- If there is an error reading from the PDF, or writing to the XML.public void generateXMLHighlight(PDDocument pdDocument, String[] sWords, Writer xmlOutput) throws IOException
pdDocument
- The PDF to find words in.sWords
- The words to search for.xmlOutput
- The resulting output xml file.
IOException
- If there is an error reading from the PDF, or writing to the XML.protected void endPage(PDPage pdPage) throws IOException
PDFTextStripper
endPage
in class PDFTextStripper
pdPage
- The page we are about to process.
IOException
- If there is any error writing to the stream.PDFTextStripper.endPage( PDPage )
public static void main(String[] args) throws IOException
args
- The command line arguments to the application.
IOException
- If there is an error generating the highlight file.public Color getHighlightColor()
public void setHighlightColor(Color color)
color
- The color to highlight strings with.public void setHighlightColor(String color)
color
- The color to use for highlighting. Should be in the format of "FF0000".public String getHighlightColorAsString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |