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

Free Support Forum - aspose.com

Word doc with default font set exports to HTML wrong with header

I am using Aspose.Words for .NET (latest) and when I have a document that has the default font set and then add a header with a different font and export to HTML, the resulting HTML seems to pick up the font that was applied to the header, not the default font of the document.

Hi @brttnybrns
Thank you for your interest in Aspose products.

Maybe the font is missing. You can try disabling font substitution. Can you attach an example document where this is happening?

Keep in mind there is 2 way to convert a Word document to Html:

  1. Html (flow format)
  2. HtmlFixed (fixed page format).

Aspose.Words do not substitute fonts upon conversion between flow formats. This makes me believe you are converting to HtmlFixed format.
It is not possible to disable font substitution in HtmlFixed. Upon converting to fixed page formats Aspose.Words need to measure text and other document items to properly place elements on the page, the process is called Page Layout. The fonts must be present when the page layout is built to measure and layout text elements.

Best regards.

Hi Carolos!

I’m adding Ashton, our dev who found the bug, to this thread.

Thanks! :slightly_smiling_face:

Brittany