I am trying to do the following
- Convert the TL_Summary_report_Template.xlsx into html
- Convert the html back to Excel
If you notice my excel output (both good and bad excel), the Paypal logo in good excel shows the logo nicely but in bad excel it doesn’t show properly.
The difference between those 2 excels are, the html input given to those excel conversion in step 2 for both cases are different. In case of good excel the html input is TL_Summary_Report_Template.html and in case of bad excel the html input is TL_Summary_Report_Template-widthscalable.html.
These 2 html files are generated in step 1 using TL_Summary_report_Template.xlsx with one setting different ‘opts.setWidthScalable’ as shown below. If I set the width scalable and generate the html, then the excel generated from this html in step2 has improper logo, but if I do not set the width scalable during html generation, the excel generated out of this html shows the logo correctly. But I do need to set the width scalable to overcome other issues. So would like to know if we can anyway override this for image alone?
public byte[] convertToHtml(Workbook wb) throws Exception {
HtmlSaveOptions opts = new HtmlSaveOptions();
// opts.setWidthScalable(true);
opts.setExportActiveWorksheetOnly(true);
opts.setExportImagesAsBase64(true);
ByteArrayOutputStream os = new ByteArrayOutputStream();
wb.save(os, opts);
return os.toByteArray();
}
Attached those files for reference
share.zip (70.4 KB)