@@ -0,0 +1,1839 @@
+import java.io.ByteArrayOutputStream;%0Aimport java.io.FileInputStream;%0A%0Aimport javax.xml.parsers.DocumentBuilderFactory;%0Aimport javax.xml.transform.OutputKeys;%0Aimport javax.xml.transform.Transformer;%0Aimport javax.xml.transform.TransformerFactory;%0Aimport javax.xml.transform.dom.DOMSource;%0Aimport javax.xml.transform.stream.StreamResult;%0A%0Aimport org.apache.poi.hwpf.HWPFDocumentCore;%0Aimport org.apache.poi.hwpf.converter.WordToHtmlConverter;%0Aimport org.apache.poi.hwpf.converter.WordToHtmlUtils;%0Aimport org.w3c.dom.Document;%0A%0A%0Apublic class Main %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09String docPath = %22xxx.doc%22;%0A%09%09convertDoc(docPath);%0A%09%7D%0A%09public static void convertDoc(String path) %7B%0A%09%09try%0A%09%09%7B%0A%09%09%09// TODO Auto-generated method stub%0A%09%09%09HWPFDocumentCore wordDocument = WordToHtmlUtils.loadDoc(new FileInputStream(path));%0A%0A%09%09    WordToHtmlConverter wordToHtmlConverter = new WordToHtmlConverter(%0A%09%09            DocumentBuilderFactory.newInstance().newDocumentBuilder()%0A%09%09                    .newDocument());%0A%09%09    wordToHtmlConverter.processDocument(wordDocument);%0A%09%09    Document htmlDocument = wordToHtmlConverter.getDocument();%0A%09%09    ByteArrayOutputStream out = new ByteArrayOutputStream();%0A%09%09    DOMSource domSource = new DOMSource(htmlDocument);%0A%09%09    StreamResult streamResult = new StreamResult(out);%0A%0A%09%09    TransformerFactory tf = TransformerFactory.newInstance();%0A%09%09    Transformer serializer = tf.newTransformer();%0A%09%09    serializer.setOutputProperty(OutputKeys.ENCODING, %22UTF-8%22);%0A%09%09    serializer.setOutputProperty(OutputKeys.INDENT, %22yes%22);%0A%09%09    serializer.setOutputProperty(OutputKeys.METHOD, %22html%22);%0A%09%09    serializer.transform(domSource, streamResult);%0A%09%09    out.close();%0A%0A%09%09    String result = new String(out.toByteArray());%0A%09%09    System.out.println(result);%0A%09%09%7D%0A%09%09catch(Exception e)%0A%09%09%7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add src folder