Cin*_*gpi -1
要将 DOC 文件转换为 HTML,请查看此 ( Convert Word doc to HTMLprogrammatically in Java)
或者使用这个:
XWPFDocument docx = new XWPFDocument(OPCPackage.openOrCreate(new File("hello.docx")));
XWPFWordExtractor wx = new XWPFWordExtractor(docx);
String text = wx.getText();
System.out.println("text = "+text);
Run Code Online (Sandbox Code Playgroud)