We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Words for Java word转html,转换后第一页内容挤到一页了且有空白区域

word转换后第一页内容挤到一页了且有空白区域.zip (173.6 KB)

转换结果、原文件、转换前后对比图见附件。 使用Aspose.Words for Java 20.6版本。
转换代码如下:
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,

请使用以下Java代码在DOC到HTML转换期间解决此问题:

LoadOptions loadOptions = new LoadOptions();
loadOptions.getLanguagePreferences().setDefaultEditingLanguage(EditingLanguage.CHINESE_PRC);
Document document = new Document("C:\\Temp\\217376\\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);
document.acceptAllRevisions();
document.save("C:\\Temp\\217376\\awjava-20.8.html", options);