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

Free Support Forum - aspose.com

Insert HTML in DOCX Document & Preserve Font Size of Subscript or Superscript Table Content using C#

Hi, we have the attached html which contains a table with subscript and superscript fonts.

If we open this html file with MS Word we see the correct font size for subscript and superscript fonts (6 - 6.5 - 7 - 7.5).

But if we insert this html code into a new document via DocumentBuilder

 var docx = new Document();
 var builder = new DocumentBuilder(docx);
 builder.InsertHtml(html);
 docx.Save("Test1.docx");

The font sizes in the new document are wrong for subscript and superscript fonts (7.5 - 8 - 9 - 9.5 instead of 6 - 6.5 - 7 - 7.5). Is there a way to fix this?

Attached the html used for this test and the generated document.

Attachments.zip (7.8 KB)

@davidepedrocca,

We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-20262. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.