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

Free Support Forum - aspose.com

Pdf conversion and fonts


I use Aspose.words to generate word files with mircrosoft fonts.
Under Linux system, I need to convert those files to pdf files.
Is it possible to embed only used fonts in word documents in oder to generate pdf under Linux with the same microsoft fonts?

Hi Hervé,

Thanks for your inquiry. Yes, it is possible. To embed a TrueType font in a saved document in Microsoft Office Word 2016, follow these steps:

First, select the File option from the Word ribbon at the top of the screen.
From the options bar on the left-hand side, choose Options.
A Word Options window will come up. Select the Save option from the banner on the left-hand side.
Under Preserve fidelity when sharing this document select the check box next to Embed fonts in the file. Then click OK.

We suggest you please read the following article:

Font Availability and Substitution

You can embed the fonts in the document using Aspose.Words. Please check the following code snippet. Moreover, please read the members of FontInfoCollection class. Hope this helps you.

Document doc = new Document(MyDir + "input.docx");
FontInfoCollection fontInfos = doc.FontInfos;
fontInfos.EmbedTrueTypeFonts = true;
fontInfos.EmbedSystemFonts = true;
fontInfos.SaveSubsetFonts = true;