public class WordFinder
extends java.lang.Object
| Constructor and Description |
|---|
WordFinder(Document doc,
WordFinderVersion algVersion,
WordFinderConfig wbConfig)
Create a word finder
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete() |
boolean |
enumWords(int pageNum,
WordProc wordProc)
Extracts words, one at a time, from the specified page or the entire document.
|
java.util.List<Word> |
getWordList(int pageNum)
Finds all words on the specified page and returns a list containing the words.
|
public WordFinder(Document doc, WordFinderVersion algVersion, WordFinderConfig wbConfig)
doc - document in which to find wordsalgVersion - algorithm version to usewbConfig - configuration for this word finderpublic void delete()
public boolean enumWords(int pageNum,
WordProc wordProc)
Only words within or partially within the page's crop box (see Page::CropBox) are enumerated. Words outside the crop box are skipped.
Word objects passed to wordProc become invalid once the call to EnumWords returns, or if the page number changes between calls to the WordProc.
pageNum - The page number from which to extract words. Pass AllPages to sequentially process all pages in the document.wordProc - A user-supplied callback to call once for each word found. Enumeration halts if wordProc returns false.public java.util.List<Word> getWordList(int pageNum)
pageNum - the page number for which to get the list of words.