Aspose.Words for Java word转html,红头空白太高

转换结果、原文件、转换前后对比图见附件。 使用的Aspose.Words for Java 20.5版本。
转换代码如下:word红红头空白太高.zip (257.7 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,

请将默认编辑语言设置为CHINESE_PRC,然后转换为HTML固定格式。 请尝试以下Java代码。 希望这可以帮助。

LoadOptions loadOptions = new LoadOptions();
loadOptions.getLanguagePreferences().setDefaultEditingLanguage(EditingLanguage.CHINESE_PRC);
Document doc = new Document("E:\\Temp\\213782\\in.doc", loadOptions);

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("E:\\Temp\\213782\\awjava-20.5.html", options);