Two page to three page!

License wordLicense = new License();
wordLicense
.setLicense(new FileInputStream(
"D:\\Landray\\AttConverter\\FileConverter\\AsposeConverter\\HTMLConverter\\config\\license\\Aspose.Total.Java.lic"));
Document wordDocument = new Document("C:\\Users\\Lixp\\Desktop\\1.doc");
wordDocument.acceptAllRevisions();
HtmlFixedSaveOptions saveOptions = new HtmlFixedSaveOptions();
saveOptions.setPrettyFormat(true);
saveOptions.setExportEmbeddedCss(true);
saveOptions.setExportEmbeddedFonts(true);
saveOptions.setExportEmbeddedImages(true);
saveOptions.setExportEmbeddedSvg(true);
saveOptions.setWarningCallback(new com.aspose.words.IWarningCallback() {
@Override
public void warning(com.aspose.words.WarningInfo warningInfo) {
System.out
.println(warningInfo.getWarningType() == com.aspose.words.WarningType.FONT_SUBSTITUTION ? ("Font substitution: " + warningInfo
.getDescription()) : "");
}
});
OutputStream outputStream = null;
int pageCount = wordDocument.getPageCount();
for (int i = 0; i < pageCount; i++) {
saveOptions.setPageIndex(i);
saveOptions.setPageCount(1);
outputStream = new FileOutputStream(
"C:\\Users\\Lixp\\Desktop\\1\\convert" + "_page-" + i
+ ".html");
wordDocument.save(outputStream, saveOptions);
outputStream.close();
}

Hi Xu,


Thanks for your inquiry. But when you save this .doc to .pdf format using Microsoft Word 2016, you’ll observe the same behavior. Please see attached Microsoft Word 2016 generated .pdf document. So, this seems to be an expected behavior as Aspose.Words mimics Microsoft Word in this case. If we can help you with anything else, please feel free to ask.

PS: Aspose.Words uses the same layout engine for converting Word to PDF and Word to HtmlFixed formats.

Best regards,