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