/** * 创建一个简单的docx */ private static void createDocx() { // Create the package WordprocessingMLPackage wordMLPackage; try { wordMLPackage = WordprocessingMLPackage.createPackage(); // 另存为新的文件 wordMLPackage.save(new File("C:/Users/liqiang/Desktop/docx4j/helloworld.docx")); ...
public static void convertDocxToHtml(String docxFilePath,String htmlPath) throws Exception{ WordprocessingMLPackage wordMLPackage= Docx4J.load(new java.io.File(docxFilePath)); HTMLSettings htmlSettings = Docx4J.createHTMLSettings(); String imageFilePath=htmlPath.substring(0,htmlPath.lastIndexOf("/...
/** * 创建一个简单的docx */ private static void createDocx() { // Create the package WordprocessingMLPackage wordMLPackage; try { wordMLPackage = WordprocessingMLPackage.createPackage(); // 另存为新的文件 wordMLPackage.save(new File("C:/Users/liqiang/Desktop/docx4j/helloworld.docx")); ...