@Beta public class WordToTextConverter extends AbstractWordConverter
UNICODECHAR_NO_BREAK_SPACE, UNICODECHAR_NONBREAKING_HYPHEN, UNICODECHAR_ZERO_WIDTH_SPACE
Constructor and Description |
---|
WordToTextConverter()
Creates new instance of
WordToTextConverter . |
WordToTextConverter(Document document)
Creates new instance of
WordToTextConverter . |
WordToTextConverter(TextDocumentFacade textDocumentFacade) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterProcess()
Special actions that need to be called after processing complete, like
updating stylesheets or building document notes list.
|
Document |
getDocument() |
String |
getText() |
static String |
getText(DirectoryNode root) |
static String |
getText(File docFile) |
static String |
getText(HWPFDocumentCore wordDocument) |
boolean |
isOutputSummaryInformation() |
static void |
main(String[] args)
Java main() interface to interact with
WordToTextConverter |
protected void |
outputCharacters(Element block,
CharacterRun characterRun,
String text) |
protected void |
processBookmarks(HWPFDocumentCore wordDocument,
Element currentBlock,
Range range,
int currentTableLevel,
List<Bookmark> rangeBookmarks)
Wrap range into bookmark(s) and process it.
|
protected void |
processDocumentInformation(SummaryInformation summaryInformation) |
void |
processDocumentPart(HWPFDocumentCore wordDocument,
Range range) |
protected void |
processDrawnObject(HWPFDocument doc,
CharacterRun characterRun,
OfficeDrawing officeDrawing,
String path,
Element block) |
protected void |
processEndnoteAutonumbered(HWPFDocument wordDocument,
int noteIndex,
Element block,
Range endnoteTextRange) |
protected void |
processFootnoteAutonumbered(HWPFDocument wordDocument,
int noteIndex,
Element block,
Range footnoteTextRange) |
protected void |
processHyperlink(HWPFDocumentCore wordDocument,
Element currentBlock,
Range textRange,
int currentTableLevel,
String hyperlink) |
protected void |
processImage(Element currentBlock,
boolean inlined,
Picture picture) |
protected void |
processImage(Element currentBlock,
boolean inlined,
Picture picture,
String url) |
protected void |
processImageWithoutPicturesManager(Element currentBlock,
boolean inlined,
Picture picture) |
protected void |
processLineBreak(Element block,
CharacterRun characterRun) |
protected void |
processNote(HWPFDocument wordDocument,
Element block,
Range noteTextRange) |
protected boolean |
processOle2(HWPFDocument wordDocument,
Element block,
Entry entry) |
protected void |
processPageBreak(HWPFDocumentCore wordDocument,
Element flow) |
protected void |
processPageref(HWPFDocumentCore wordDocument,
Element currentBlock,
Range textRange,
int currentTableLevel,
String pageref) |
protected void |
processParagraph(HWPFDocumentCore wordDocument,
Element parentElement,
int currentTableLevel,
Paragraph paragraph,
String bulletText) |
protected void |
processSection(HWPFDocumentCore wordDocument,
Section section,
int s) |
protected void |
processTable(HWPFDocumentCore wordDocument,
Element flow,
Table table) |
void |
setOutputSummaryInformation(boolean outputDocumentInformation) |
getCharacterRunTriplet, getFontReplacer, getNumberColumnsSpanned, getNumberRowsSpanned, getPicturesManager, processCharacters, processDeadField, processDocument, processDrawnObject, processDropDownList, processField, processNoteAnchor, processParagraphes, processSingleSection, processSymbol, setFontReplacer, setPicturesManager, tryDeadField
public WordToTextConverter() throws ParserConfigurationException
WordToTextConverter
. Can be used for
output several HWPFDocument
s into single text document.ParserConfigurationException
- if an internal DocumentBuilder
cannot be createdpublic WordToTextConverter(Document document)
WordToTextConverter
. Can be used for
output several HWPFDocument
s into single text document.document
- XML DOM Document used as storage for text piecespublic WordToTextConverter(TextDocumentFacade textDocumentFacade)
public static String getText(DirectoryNode root) throws Exception
Exception
public static String getText(HWPFDocumentCore wordDocument) throws Exception
Exception
public static void main(String[] args)
WordToTextConverter
Usage: WordToTextConverter infile outfile
Where infile is an input .doc file ( Word 95-2007) which will be rendered as plain text into outfileprotected void afterProcess()
AbstractWordConverter
afterProcess
in class AbstractWordConverter
public Document getDocument()
getDocument
in class AbstractWordConverter
public boolean isOutputSummaryInformation()
protected void outputCharacters(Element block, CharacterRun characterRun, String text)
outputCharacters
in class AbstractWordConverter
protected void processBookmarks(HWPFDocumentCore wordDocument, Element currentBlock, Range range, int currentTableLevel, List<Bookmark> rangeBookmarks)
AbstractWordConverter
processBookmarks
in class AbstractWordConverter
protected void processDocumentInformation(SummaryInformation summaryInformation)
processDocumentInformation
in class AbstractWordConverter
public void processDocumentPart(HWPFDocumentCore wordDocument, Range range)
processDocumentPart
in class AbstractWordConverter
protected void processDrawnObject(HWPFDocument doc, CharacterRun characterRun, OfficeDrawing officeDrawing, String path, Element block)
processDrawnObject
in class AbstractWordConverter
protected void processEndnoteAutonumbered(HWPFDocument wordDocument, int noteIndex, Element block, Range endnoteTextRange)
processEndnoteAutonumbered
in class AbstractWordConverter
protected void processFootnoteAutonumbered(HWPFDocument wordDocument, int noteIndex, Element block, Range footnoteTextRange)
processFootnoteAutonumbered
in class AbstractWordConverter
protected void processHyperlink(HWPFDocumentCore wordDocument, Element currentBlock, Range textRange, int currentTableLevel, String hyperlink)
processHyperlink
in class AbstractWordConverter
protected void processImage(Element currentBlock, boolean inlined, Picture picture)
processImage
in class AbstractWordConverter
protected void processImage(Element currentBlock, boolean inlined, Picture picture, String url)
processImage
in class AbstractWordConverter
protected void processImageWithoutPicturesManager(Element currentBlock, boolean inlined, Picture picture)
processImageWithoutPicturesManager
in class AbstractWordConverter
protected void processLineBreak(Element block, CharacterRun characterRun)
processLineBreak
in class AbstractWordConverter
protected void processNote(HWPFDocument wordDocument, Element block, Range noteTextRange)
protected boolean processOle2(HWPFDocument wordDocument, Element block, Entry entry) throws Exception
processOle2
in class AbstractWordConverter
Exception
protected void processPageBreak(HWPFDocumentCore wordDocument, Element flow)
processPageBreak
in class AbstractWordConverter
protected void processPageref(HWPFDocumentCore wordDocument, Element currentBlock, Range textRange, int currentTableLevel, String pageref)
processPageref
in class AbstractWordConverter
protected void processParagraph(HWPFDocumentCore wordDocument, Element parentElement, int currentTableLevel, Paragraph paragraph, String bulletText)
processParagraph
in class AbstractWordConverter
protected void processSection(HWPFDocumentCore wordDocument, Section section, int s)
processSection
in class AbstractWordConverter
protected void processTable(HWPFDocumentCore wordDocument, Element flow, Table table)
processTable
in class AbstractWordConverter
public void setOutputSummaryInformation(boolean outputDocumentInformation)
Copyright © 2020. All rights reserved.