Exported Word Document has text with large font size not completely visible

We have many ‘jQuery sheet’ worksheets (https://github.com/Spreadsheets/WickedGrid) in our ASP.NET MVC Application. Using Aspose.Words.Document, we routinely export the sheets to Microsoft Word. For the most part, this functionality works reasonably well.

However, we noticed that if one were to increase the font size of the numbers inside a cell to greater than, say, Times New Roman 12, in the web page, save it and then export the sheet as a Word document, the exported document shows this cell and its content (number) only about 50% of its portion vertically cutting-off the top part for some reason. Note, that the cell with this large font appears normal in the HTML page, as expected.

To illustrate my point, I am attaching here a snap-shot that will help explain it visually.

Also, in the exported document, we have tried to adjust any cell properties via the ‘Table Properties’ dialog box, but were unsuccessful to find a property that will allow proper display of the affected cell content. The Aspose.Wrods.Document API pretty much parallels what is available in Word for manipulation of content, so that was also not helpful.

How can we fix this problem? Thank you for your help.

Hi Narendra,

Thanks for your inquiry. Please try latest version of Aspose.Words for .NET 16.10.0. Hope this helps you.

If you still face problem, please attach the following resources here for testing:

  • Your input document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip them and Click ‘Reply’ button that will bring you to the ‘reply page’ and there at the bottom you can include any attachments with that post by clicking the ‘Add/Update’ button.

Thank you. I downloaded the Aspose.Words version 16.10.0 assemblies and tried to run the application, but got an error for license. We do have a product license, but it is for an older version, and that does not seem to work with this downloaded (newer) version. Please see snapshot of error. How can I proceed to using the newer version please?

Hi Narendra,

Thanks for your inquiry. We suggest you please request for 30-days temporary license from here:
Get temporary license

If you still face problem, please share the detail, which is requested in my previous post, for testing. We will investigate the issue and provide you more information.

Even after using the latest Aspose DLLs (version 16.10.0.0), the exported Word document had the same exact issue in our actual application.

As you suggested I therefore constructed a sample ASP.NET MVC Application that has a page that can generate the Export.

Upon running this sample application (attached as a zipped Visual Studio Solution) and exporting the single cell as a one-cell Word table, you can see that even the large font size DOES NOT impede visibility of the entire cell contents.

However, if you were to adjust the row height of the exported table to a bit less than 0.44 units or less, you will see that a similar effect is seen as is seen in our actual App’s exported Word document (also attached, named “Aspose_Word_Export_With_Font_Issue.docx”).

Can you please examine both these documents, run the sample MVC solution to generate the Doc file using the red link “Aspose.Words Export” on the landing page, and let us know where the issue may lie?

Hi Narendra,

Thanks for sharing the detail. Unfortunately, we are unable to execute the shared application. Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing. We will investigate the issue on our side and provide you more information.

Ok. I am attaching a Console App for your reference. However, this is no different than what you may already have from your sample downloads and does not illustrate the point because it gives a Word document that can display the large font text properly.

I think it might be more useful for you to look at the previous Word attachment “Aspose_Word_Export_With_Font_Issue.docx” that illustrates the issue.

What is most perplexing in that attachment is that in the cells which have their content-top not being visible as they are cut-off, if one were to INCREASE Row height using the ‘Table Properties’ dialog box, thus giving the cell enough vertical room to display the large (size 36) font, still the content remains cut-off at the top. This is the crux of the issue. Anything that you can tell us that our application is doing to generate that Word document, is what we are looking for as an answer. Thank you for your help.

Hi Narendra,

Thanks for your inquiry. You are facing the shared issue due the line spacing of paragraph. It is ‘Exactly’. See the attached image for detail. Please set it to ‘AtLeast’ to get the desired output.

ParagraphFormat.LineSpacing property is used to get or set the line spacing (in points) for the paragraph. Use ParagraphFormat.LineSpacingRule property to get or set the line spacing for the paragraph.

Thank you for your answer and the attachment. I had no idea that one can have paragraphs inside of a table, so, I was looking in the wrong direction completely! Thank you again!

Hi Narendra,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.