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

Free Support Forum - aspose.com

Converting Word to Pdf - How to use different Fonts

Hello Aspose,

I am trying to convert a word document into a pdf using Aspose.Words. In the word template I am using different fonts for instance Times-New-Roman and Arial. Unfortunatly after generating the pdf the fonts look excatly the same. Is there a default font setted and how can I change it or is there a possibility to add fonts to aspose?

Thanks in advance

@KHd

Thanks for your inquiry. Please note that Aspose.Words requires TrueType fonts when rendering document to fixed-page formats (JPEG, PNG, PDF or XPS). Please refer to the following article:

[How Aspose.Words Uses True Type Fonts]( https://docs.aspose.com/words/net/manipulating-and-substitution-truetype-fonts)

FontSettings class specifies font settings for a document. By default, all documents use single static font settings instance. It could be accessed by DefaultInstance property. You can use FontSettings.SetFontSubstitutes method to override substitute (alternative) font names for given original font name.

We suggest you please check the members of FontSettings class. Please check the following code example.

FontSettings fontSettings = new FontSettings();
fontSettings.SetFontSubstitutes("Times New Roman", new String[] { "Slab", "Arvo" });