Saving in HTML format with some format issues

Hi Aspose team


We are working on saving Word in HTML format using Aspose Word 16.11.0 for cross-platform viewing.

Here is our code for test in Linux environment:
Document doc = new Document(“custom/input/docx/CAT Pusheen Meow base.docx”);
Document pageDoc;
LayoutCollector layoutCollector;
DocumentPageSplitter splitter;
ByteArrayOutputStream output = new ByteArrayOutputStream();
HtmlSaveOptions saveOp = new HtmlSaveOptions();
saveOp.setExportImagesAsBase64(true);
saveOp.setExportTextInputFormFieldAsText(false);
saveOp.setExportTocPageNumbers(true);
saveOp.setExportPageSetup(true);
saveOp.setExportDocumentProperties(true);
saveOp.setExportRelativeFontSize(false);

layoutCollector = new LayoutCollector(doc);
doc.updatePageLayout();
splitter = new DocumentPageSplitter(layoutCollector);

byte[] outputContent;
String outputPath = “custom/output/docx”;
String blockID = UUID.randomUUID().toString();

for (int page = 1; page <= doc.getPageCount(); page++) {
pageDoc = splitter.getDocumentOfPage(page);
output.reset();
pageDoc.save(output, saveOp);

outputContent = output.toByteArray();

File outputDir = new File(outputPath + “/” + blockID + “/”);
if (!outputDir.exists())
outputDir.mkdir();

IOUtils.write(outputContent, new FileOutputStream(outputPath + “/” + blockID + “/” + page + “.html”));

}

In the result, there several issues of the format.

1.There some rectangles seems to be shorten.
2.Some text blocks are covered by another.
3.Maybe there should be more line breaker to make the text move to the much lower position?

Anyway to improve this? Or is this issue a bug?

Craig

Hi Craig,


Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 16.11.0, we managed to reproduce these bugs on our end. To address these problems, we have logged an issue in our bug tracking system. The ID of this issue is WORDSNET-14526. Your request has also been linked to the appropriate issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan