Package org.apache.poi.hwpf.converter
Class WordToTextConverter
- java.lang.Object
-
- org.apache.poi.hwpf.converter.AbstractWordConverter
-
- org.apache.poi.hwpf.converter.WordToTextConverter
-
@Beta public class WordToTextConverter extends AbstractWordConverter
-
-
Constructor Summary
Constructors Constructor Description WordToTextConverter()Creates new instance ofWordToTextConverter.WordToTextConverter(TextDocumentFacade textDocumentFacade)WordToTextConverter(Document document)Creates new instance ofWordToTextConverter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DocumentgetDocument()StringgetText()static StringgetText(File docFile)static StringgetText(HWPFDocumentCore wordDocument)static StringgetText(DirectoryNode root)booleanisOutputSummaryInformation()static voidmain(String[] args)Java main() interface to interact withWordToTextConvertervoidprocessDocumentPart(HWPFDocumentCore wordDocument, Range range)voidsetOutputSummaryInformation(boolean outputDocumentInformation)-
Methods inherited from class org.apache.poi.hwpf.converter.AbstractWordConverter
getFontReplacer, getPicturesManager, processDocument, setFontReplacer, setPicturesManager
-
-
-
-
Constructor Detail
-
WordToTextConverter
public WordToTextConverter() throws ParserConfigurationExceptionCreates new instance ofWordToTextConverter. Can be used for output severalHWPFDocuments into single text document.- Throws:
ParserConfigurationException- if an internalDocumentBuildercannot be created
-
WordToTextConverter
public WordToTextConverter(Document document)
Creates new instance ofWordToTextConverter. Can be used for output severalHWPFDocuments into single text document.- Parameters:
document- XML DOM Document used as storage for text pieces
-
WordToTextConverter
public WordToTextConverter(TextDocumentFacade textDocumentFacade)
-
-
Method Detail
-
getText
public static String getText(DirectoryNode root) throws Exception
- Throws:
Exception
-
getText
public static String getText(HWPFDocumentCore wordDocument) throws Exception
- Throws:
Exception
-
main
public static void main(String[] args) throws Exception
Java main() interface to interact withWordToTextConverterUsage: WordToTextConverter infile outfile
Where infile is an input .doc file ( Word 95-2007) which will be rendered as plain text into outfile- Throws:
Exception
-
getDocument
public Document getDocument()
- Specified by:
getDocumentin classAbstractWordConverter
-
isOutputSummaryInformation
public boolean isOutputSummaryInformation()
-
processDocumentPart
public void processDocumentPart(HWPFDocumentCore wordDocument, Range range)
-
setOutputSummaryInformation
public void setOutputSummaryInformation(boolean outputDocumentInformation)
-
-