Aspose.Words for Java word转html,word文档转换后格式有差别

word文档转换后格式有差别.zip (345.3 KB)
转换代码如下:
Document document = new Document(sourceFileName);
HtmlFixedSaveOptions options = new HtmlFixedSaveOptions();
options.setUseTargetMachineFonts(false);
options.setUseHighQualityRendering(true);
options.setEncoding(Charset.forName(“UTF-8”));
options.setExportEmbeddedFonts(true);
options.setShowPageBorder(true);
document.acceptAllRevisions();
document.save(targetFileName, options);

@xiangma,

在使用Aspose.Words for Java的最新许可版本(20.12)进行了初步测试之后,我们最终无法重现此问题。 最后,我们使用以下简单的Java代码将您的DOCX文档转换为HTML Fixed格式:

Document document = new Document("C:\\temp\\223263\\in.docx");
HtmlFixedSaveOptions options = new HtmlFixedSaveOptions();
options.setUseTargetMachineFonts(false);
options.setUseHighQualityRendering(true);
options.setEncoding(Charset.forName("UTF-8"));
options.setExportEmbeddedFonts(true);
options.setShowPageBorder(true);
document.acceptAllRevisions();
document.save("C:\\Temp\\223263\\awjava-20.12.html", options);

因此,建议您升级到最新版本的Aspose.Words for Java。