我很难理解为什么我的脚本无法识别通过Word中的页眉和页脚工具添加的.docx文档中的页眉和页脚。这是我的代码
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(f);
HTMLSettings htmlSettings = Docx4J.createHTMLSettings();
htmlSettings.setWmlPackage(wordMLPackage);
htmlSettings.setImageDirPath("java.io.tmpdir");
htmlSettings.setImageTargetUri("java.io.tmpdir");
String htmlFilePath = "C:\\test.html";
OutputStream os = new java.io.FileOutputStream(htmlFilePath);
// write html
Docx4J.toHTML(htmlSettings, os, Docx4J.FLAG_EXPORT_PREFER_XSL);
所有内容都应该很简单,但是由于某些原因它无法识别该部分。我浏览了文档,没有找到必须应用的任何其他设置,以便docx4j开始识别页眉和页脚部分。有任何想法吗 ?预先感谢。