Aspose.Words for Java word转html,word转换后表格所有列宽被拉宽

word转换后表格所有列宽被拉宽.zip (562.9 KB)
代码:
cument = 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,

在使用许可的最新 (21.7) 版 Aspose.Words for Java 进行初始测试后,我们最终无法重现任何此类问题。 我们使用您的代码将 Word DOC 转换为 HTML 固定格式:

所以,请升级到最新版本的 Aspose.Words for Java

我使用了但是并没有解决,请再查看下。

@xiangma,

请查看这些源 Word DOC 和 Aspose.Words 21.7 生成的 HTML-Fixed 文件并尝试运行以下 Java 代码:

Document document = new Document("c:\\temp\\232182\\in.doc");
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\\232182\\awjava-21.7.html", options);

你在上面的 HTML 中看到同样的问题了吗? 如果是,那么您能否提供一张对比截图,突出显示(圈出)Aspose.Words 生成的输出 HTML 中的问题区域,并将其附在此处供我们参考? 然后,我们将进一步调查该问题并为您提供更多信息。

doc and html.zip (551.4 KB)
具体文件及出错对比图已上传

@xiangma,

同样,当使用最新的 21.8 版本的 Aspose.Words 运行以下 Java 代码时,我们无法重现此问题:

Document doc = new Document("C:\\Temp\\232182\\5\\doc and html\\in.doc");

HtmlFixedSaveOptions options = new HtmlFixedSaveOptions();
options.setUseTargetMachineFonts(false);
options.setUseHighQualityRendering(true);
options.setEncoding(Charset.forName("UTF-8"));
options.setExportEmbeddedFonts(true);
options.setShowPageBorder(true);
doc.acceptAllRevisions();

doc.save("C:\\temp\\232182\\5\\doc and html\\awjava-21.8.html", options);