AsposeRegister.getLicense();
LoadOptions loadOptions = new LoadOptions();
loadOptions.getLanguagePreferences().setDefaultEditingLanguage(EditingLanguage.CHINESE_PRC);
Document document = new Document("C:\\Users\\Administrator\\Desktop\\33.docx",loadOptions);
document.getCompatibilityOptions().optimizeFor(MsWordVersion.WORD_2019);
System.out.println(document.getPageCount());
word文档 插入表格,设置了表格段落的行距为多倍行距1.25,且在兼容性选项中设置"在表格中将行高调至网格高度"为true,通过document.getPageCount()获取的页数和MS word 渲染的页数不一致,如附件
33.docx (14.5 KB)
,通过Aspose.Word获取到总页数是1,MS word打开后查看的页数是2.