I am trying to convert a simple html file to excel file using the following 4 lines of code. It does convert but the output excel doesn’t have the formattings same as html. For example formatting like bold/italics/background color are lost in Excel
File file = new File("test1.html");
//Create byte array input stream from the byte array
ByteArrayInputStream baisHtml = new ByteArrayInputStream(FileUtils.readFileToByteArray(file));
//Create html load options
HtmlLoadOptions opts = new HtmlLoadOptions();
opts .setAutoFitColsAndRows(true);
//Create workbook from your HTML string
Workbook wb = new Workbook(baisHtml, opts);
//Save the workbook in output format
wb.save("test1.xlsx");
We are evaluating your product, this would be one of the decision criteria for us. Hoping to see the response soon