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

Free Support Forum - aspose.com

Wrong font size in a table exported from Excel

Hi, we are trying to export a table from an Excel spreadsheet range to a new Word document.

In the attached spreadsheet (Test1.xlsx), the RANGE1 has 4 rows with different font sizes (6, 6.5, 7, 7.5).
Then, we export the range with the attached C# program by using

  • Aspose.Cells.HtmlSaveOptions to get the HTML of the range
  • Aspose.Words.DocumentBuilder.InsertHtml to import the html table into a new Word document.

However, when we open the generated document (Test1.docx), we encounter the following issues in the exported table:

  • The second row has font size 6 instead of 6.5
  • The fourth row has font size 7 instead of 7.5

Attachments.zip (13.4 KB)

@davidepedrocca

Please generate the HTML using the latest version of Aspose.Cells 20.3 for .NET and share it here for testing. We will investigate the issue and provide you more information on it.

@davidepedrocca

The latest version of Aspose.Cells 20.3 for .NET generates the HTML that has font size 6 and 7 for second and forth rows. This issue is more related to Aspose.Cells. We are moving this forum thread to Aspose.Cells forum thread where you will be guided appropriately.

@davidepedrocca,

Thanks for the sample code and template file.

After an initial test, I am able to reproduce the issue as you mentioned by using your sample code with your template file. I used latest versions of Aspose.Words and Aspose.Cells to test the scenario/case. I found some cells’ font size is exported wrong. It generates the HTML with font sizes 6 and 7 for second and forth rows instead of 6.5 and 7.5 respectively. I have logged a ticket with an id “CELLSNET-47261” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

@davidepedrocca,

This is to inform you that we have fixed your issue now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

@davidepedrocca,

Please try our latest version/fix: Aspose.Cells for .NET v20.3.4 (attached)

Your issue should be fixed in it.

Let us know your feedback.
Aspose.Cells20.3.4 For .Net2_AuthenticodeSigned.Zip (5.3 MB)
Aspose.Cells20.3.4 For .Net4.0.Zip (5.3 MB)

Thank you for your reply.

The issue is fixed for regular fonts, however we still see wrong font sizes for subscript and superscript fonts.

Attached a workbook test case.

Attachments.zip (13.1 KB)

@davidepedrocca,

Thanks for the template file and details.

You are right. The issue is still there for wrong font sizes with subscripts and superscripts as I tested using your new file. I have reopened your issue and we will look into it soon.

@davidepedrocca,
This is to inform you that we have fixed your issue (logged earlier as “CELLSNET-47261”) now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

@davidepedrocca,

Please try our latest version/fix: Aspose.Cells for .NET v20.3.6 (attached)

Your issue (regarding subscripts and superscripts fonts) should be fixed in it.

Let us know your feedback.
Aspose.Cells20.3.6 For .Net2_AuthenticodeSigned.Zip (5.3 MB)
Aspose.Cells20.3.6 For .Net4.0.Zip (5.3 MB)

Thank you for your reply, but we still see wrong font sizes on superscript and subscript fonts, as shown in the attached screenshots.

Screenshots.zip (55.4 KB)

@davidepedrocca,

Thanks for the screenshots.

Could you also share the output HTML file (you may save to disk via Aspose.Cells in code), zip the file(s) and provide us, we will check your issue soon.

@davidepedrocca,
We have further evaluated this issue and observed that if we save the intermediate HTML file generated by Aspose.Cells and open it in MS Word, the text is rendered with proper fonts for subscript and superscript as shown in the attached files. It does not seem to be an issue with the Aspose.Cells API. You may share your feedback after testing this scenario by saving the HTML file and checking it in MS Word.

Test2.zip (14.3 KB)

Thank you for your reply.

The HTML file is ok, the problem is in this method:

Aspose.Words.DocumentBuilder.InsertHtml(html);

So, I think we have to open a new thread for Aspose.Words.

@davidepedrocca,

Yes, you may create a new thread to post your issue in Aspose.Words forum.

The issues you have found earlier (filed as CELLSNET-47261) have been fixed in Aspose.Cells for .NET v20.4. This message was posted using Bugs notification tool by Amjad_Sahi