The height of the rows in a table increased when printed to HTML

Hello,
We are currently evaluating latest Aspose.Cells library and noticed the issue with the height of the rows when workbook is exported to HTML.
The rows in Excel have height 13.0pt but in the generated HTML the rows height is 13.8pt
This seems to be regressive to Aspose Cells version 21.3 - which shows the rows height correctly when the workbook is exported to HTML.

This behavior can be seen in the latest Aspose Cells for Java version 23.7, the attached ConditionalFmt.xlsx file and the following Java code:

final String xlFile = [PATH] + “ConditionalFmt.xlsx”;

Workbook wb = new Workbook(xlFile);

String html = xlFile.replace(".xlsx", “-v” + CellsHelper.getVersion() + “.html”);
Files.deleteIfExists(Paths.get(html ));
wb.save(html );
System.out.println("Successfully created HTML file: " + html);

Key observations:
Table rows all have height of 13.8pt
When save to HTML directly from Excel, the rows have height of 13.0pt
On the table with large number of rows the difference became very noticeable (see attached screenshot)

Environment Details:

Aspose Cells for Java 23.7.2 
Java version 1.8.0_371b11
Windows 10 OS (but also reproducible under Linux).

File description in the ConditionalFmt.zip attachment contains:

  • ConditionalFmt.xlsx: Excel workbook to be used by the code above
    
  • ConditionalFmt-v23.7.2.html: HTML output file produced from the code above under Aspose Cells 23.7.2.
    
  • ConditionalFmt_html.mht: HTML output produced directly from Excel by "Save As" "Web Page (htm, html)"
    
  • WorkbookToHtml_rowHeightDIFF.png - screenshot highlighting difference in row height

Is there any setting/API that would allow to retain the same row height in the HTML?
Thank you!
ConditionalFmt.zip (239.5 KB)

@oraspose,

Thanks for the sample files and screenshot.

After an initial test, I found the issue by converting your template XLSX file to HTML. However, when I manually saved your file as HTML (Web Page) via MS Excel, I noticed that it displayed/rendered similarly to the output produced by Aspose.Cells for Java API. Therefore, we need to evaluate your issue and determine whether newer versions are rendering the HTML file correctly while older versions were rendering it incorrectly, or if it is the other way around. Additionally, please also provide the output HTML file from the older version.

We will analyze your issue in details. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSJAVA-45549

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Here is the output produced with v21.3
ConditionalFmt-v21.3.0.html.zip (4.5 KB)

Please let us know if you need anything else.
Thank you.

@oraspose,

Thanks for the output HTML file by Aspose.Cells for Java v21.3. We will look into it soon.
Once we have an update on it, we will let you know.

@oraspose
The default row height is 13.8 which is saved in the file and it’s automatic.
So it will be changed in different display scale setting or region.
The row height is 12.75 in my machine (100% scale, United States, Calibri default font).
Please update defaut font as the following codes, but now we only can get correct row height in 100% display scale setting.

// CellsHelper.setDPI(150);// we only can return 12.95
       Workbook workbook = new Workbook(dir + "ConditionalFmt.xlsx");
         AutoFitterOptions options = new AutoFitterOptions();
         options.setOnlyAuto(true) ;
         workbook.getWorksheets().get(0).autoFitRows(options);
         workbook.save(dir + "dest.html");
 CellsHelper.DPI = 150;
            Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook(dir + "ConditionalFmt.xlsx");
            AutoFitterOptions options = new AutoFitterOptions();
            options.OnlyAuto = true;
            workbook.Worksheets[0].AutoFitRows(options);
            workbook.Save(dir + "dest.html"); 

@oraspose
We have made some optimizations for the 150% display ratio in next release 23.8,
Please try the code after the 23.8 released:

  CellsHelper.setDPI(144);
       Workbook workbook = new Workbook(dir + "CELLSJAVA45548.xlsx");
         AutoFitterOptions options = new AutoFitterOptions();
         options.setOnlyAuto(true) ;
         workbook.getWorksheets().get(0).autoFitRows(options);
         workbook.save(dir + "dest.html");

Thanks, we will try it out once 23.8 release is published.
Just to let you know though, the Linux 7 OS system where these unit-tests were running has the DPI set to default 96.0:
java.lang.AssertionError: The images are different! System DPI =96.0: array lengths differed, expected … actual …

@oraspose,

We will keep you posted on new updates. Once the new version is released, we will notify you.

We will evaluate this issue and provide you with an update soon.

@oraspose
Please try the 23.8 with above cods.
As you want to get the same view as display scale 150, we have to set 144 DPI then we get the correct row height in 144 DPI as MS Excel shown.
Now maybe you have to set display scale as 100% of your machine,then you can get same result as 96 DPI