org.apache.poi.hwpf.converter
Class WordToTextConverter

java.lang.Object
  extended by org.apache.poi.hwpf.converter.AbstractWordConverter
      extended by org.apache.poi.hwpf.converter.WordToTextConverter

public class WordToTextConverter
extends AbstractWordConverter


Constructor Summary
WordToTextConverter()
          Creates new instance of WordToTextConverter.
WordToTextConverter(org.w3c.dom.Document document)
          Creates new instance of WordToTextConverter.
WordToTextConverter(TextDocumentFacade textDocumentFacade)
           
 
Method Summary
 org.w3c.dom.Document getDocument()
           
 java.lang.String getText()
           
static java.lang.String getText(org.apache.poi.poifs.filesystem.DirectoryNode root)
           
static java.lang.String getText(java.io.File docFile)
           
static java.lang.String getText(HWPFDocumentCore wordDocument)
           
 boolean isOutputSummaryInformation()
           
static void main(java.lang.String[] args)
          Java main() interface to interact with WordToTextConverter
 void processDocumentPart(HWPFDocumentCore wordDocument, Range range)
           
 void setOutputSummaryInformation(boolean outputDocumentInformation)
           
 
Methods inherited from class org.apache.poi.hwpf.converter.AbstractWordConverter
getFontReplacer, getPicturesManager, processDocument, setFontReplacer, setPicturesManager
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WordToTextConverter

public WordToTextConverter()
                    throws javax.xml.parsers.ParserConfigurationException
Creates new instance of WordToTextConverter. Can be used for output several HWPFDocuments into single text document.

Throws:
javax.xml.parsers.ParserConfigurationException - if an internal DocumentBuilder cannot be created

WordToTextConverter

public WordToTextConverter(org.w3c.dom.Document document)
Creates new instance of WordToTextConverter. Can be used for output several HWPFDocuments 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 java.lang.String getText(org.apache.poi.poifs.filesystem.DirectoryNode root)
                                throws java.lang.Exception
Throws:
java.lang.Exception

getText

public static java.lang.String getText(java.io.File docFile)
                                throws java.lang.Exception
Throws:
java.lang.Exception

getText

public static java.lang.String getText(HWPFDocumentCore wordDocument)
                                throws java.lang.Exception
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)
Java main() interface to interact with WordToTextConverter

Usage: WordToTextConverter infile outfile

Where infile is an input .doc file ( Word 95-2007) which will be rendered as plain text into outfile


getDocument

public org.w3c.dom.Document getDocument()
Specified by:
getDocument in class AbstractWordConverter

getText

public java.lang.String getText()
                         throws java.lang.Exception
Throws:
java.lang.Exception

isOutputSummaryInformation

public boolean isOutputSummaryInformation()

processDocumentPart

public void processDocumentPart(HWPFDocumentCore wordDocument,
                                Range range)

setOutputSummaryInformation

public void setOutputSummaryInformation(boolean outputDocumentInformation)