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

Free Support Forum - aspose.com

How to embed font and image while converting HTML to DOCX in file itself

Hi, I want to convert a html file into Word DOCX. My html uses custom fonts. How do I embedd font in docx file. MS Word has option to embed the font. But, how do I achieve it through aspose.net code.

Hi Pawan,

Thanks for your inquiry. Please use following code example to embed the fonts inside DOCX. Please let us know if you have any more queries.

Document doc = new Document(MyDir + "in.html");

FontInfoCollection fontInfos = doc.FontInfos;

fontInfos.EmbedTrueTypeFonts = true;

fontInfos.EmbedSystemFonts = true;

fontInfos.SaveSubsetFonts = true;

doc.Save(MyDir + "Docx With Embedded Fonts.docx");