Image was cut off in the result of HTML conversion

Hi Aspose team


We are working on Excel’s HTML conversion, and there is a problem in the result.
We found a image was cut off in the result HTML.

Here is the code for conversion test with Cells 9.0.0:

Workbook book = new Workbook(“custom/input/xlsx/pusheen_sit.xlsx”);
ByteArrayOutputStream baos = new ByteArrayOutputStream();

for (int i = 0; i < book.getWorksheets().getCount(); i++) {
Worksheet sheet = book.getWorksheets().get(i);
// only one page for test
if (i != 1) {
book.getWorksheets().get(i).setVisible(false);
}
}
HtmlSaveOptions saveOps = new HtmlSaveOptions();
saveOps.setClearData(false);
saveOps.setCreateDirectory(false);
saveOps.setExportActiveWorksheetOnly(false);
saveOps.setExportHiddenWorksheet(false);
saveOps.setParseHtmlTagInCell(true);
saveOps.setEncoding(Encoding.getUTF8());
saveOps.setHiddenRowDisplayType(HtmlHiddenRowDisplayType.REMOVE);
saveOps.setHiddenColDisplayType(HtmlHiddenColDisplayType.REMOVE);
saveOps.setExportImagesAsBase64(false);

saveOps.setStreamProvider(new IStreamProvider() {

@Override
public void initStream(StreamProviderOptions arg0) throws Exception {
arg0.setStream(new ByteArrayOutputStream());
}

@Override
public void closeStream(StreamProviderOptions arg0) throws Exception {
System.out.println(arg0.getDefaultPath());
OutputStream stream = arg0.getStream();
if (stream instanceof ByteArrayOutputStream) {
ByteArrayOutputStream bb = (ByteArrayOutputStream) stream;
IOUtils.write(bb.toByteArray(),
new FileOutputStream(“custom/output/xlsx/” + arg0.getDefaultPath()));
}
}
});
book.save(baos, saveOps);
IOUtils.write(baos.toByteArray(), new FileOutputStream(“custom/output/xlsx/stream.html”));

I have uploaded a comparison image, the Excel file, and the result of sheet #3
Please help us to analyze this issue, thank you.

Best,
Craig

Hi,


Thanks for your posting and using Aspose.Cells.

We have tested this issue with the following sample code using your source excel file and the latest version: Aspose.Cells for Java v9.0.9 and were able to observe the issue as per your description. The image is cut off in the output html.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSJAVA-42006 - Image is cut off in the output html

I have also attached the output html generated with this code for a reference.

Java
Workbook workbook = new Workbook(dirPath + “pusheen_sit.xlsx”);
workbook.save(dirPath + “pusheen_sit.html”);

Hi,

Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for Java v16.11.4 and let us know your feedback.

The issues you have found earlier (filed as CELLSJAVA-42006) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi Shakeel.Faiz


It is observed that this issue can be seen resolved in my own test.
We will do some QA test furthermore, and thanks your help.

Hi,


Sure, take your time to evaluate the latest release against your test cases. Hopefully, it will pass all your tests for your scenario.

Thank you.