org.apache.poi
poi
3.15
org.apache.poi
ooxml-schemas
1.4
org.apache.poi
poi-ooxml
3.15
org.apache.poi
poi-scratchpad
3.15
org.apache.poi
poi-ooxml-schemas
3.15
fr.opensagres.xdocreport
xdocreport
2.0.2
fr.opensagres.xdocreport
org.apache.poi.xwpf.converter.xhtml
1.0.6
首先导入上面的jar包 测试4.1.0 docx转html是会报错的 但是doc不会报错,3.17也一样 但是poi3.15不会报错 ,所以就导入3.15版本
public static void docToHtml(final String path,final String file) throws Exception{
InputStream input = new FileInputStream(path + file);
HWPFDocument wordDocument = new HWPFDocument(input);
WordToHtmlConverter wordToHtmlConverter = new WordToHtmlConverter(
DocumentBuilderFactory.newInstance().newDocumentBuilder()
.newDocument());
wor