We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Font is incorrect when setting HtmlLoadOptions (when converting an HTML document to a Workbook)

Hi Support Team,

Aspose Cells for Java version: 21.8

When explicitly setting a standard font and font size using HtmlLoadOptions, the font in the resulting Excel file is different from the specified font. This results in data values being hidden as ‘########’, because it appears the column widths have been calculated using the specified font.

This functionality is working fine in Cells for Java 21.7.

HtmlLoadOptions htmlLoadOptions = new HtmlLoadOptions();

htmlLoadOptions.setStandardFont("Calibri");
htmlLoadOptions.setStandardFontSize(11.0);

Workbook workbook = new Workbook("test.html", htmlLoadOptions);

workbook.save("test.xlsx");

In this instance, the font is set correctly to ‘Calibri’ when using 21.7, but is set to ‘Calibri Light’ when using 21.8, and column values are hidden as ‘########’.

Attached is a zip file containing:

  • test.html
  • generated xlsx files using both 21.7 and 21.8
  • a screenshot to illustrate the issue.

cells_font_issue.zip (88.5 KB)

Any advice would be appreciated!

@mclark,
This issue is reproduced and logged in our database for a detailed analysis. We will write back here once any update is ready for sharing.

This issue is logged as:
CELLSJAVA-43792 - Font is incorrect when setting HtmlLoadOptions for HTML to Excel conversion

@mclark

The issue is fixed in v21.8.7:
aspose-cells-21.8.7-java.zip (7.4 MB)

Looks to be working correctly now, thank you!

The issues you have found earlier (filed as CELLSJAVA-43792) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi