Preserving Fonts in Aspose Words to save to a pdf in Dynamics CRM

Zoe Sands, 04 February 2016

When generating a PDF document using Aspose.Words from a plugin registered in Microsoft Dynamics CRM sandbox mode, it is important to note that Aspose will not have access to the system fonts installed on the server CRM is running on. This means that any fonts specified in the Word file will not be displayed as intended, instead it will use the default Aspose font Times New Roman. For this reason you must embed the font files you use in your word document so that they are available to Aspose to generate your Pdf.

To embed fonts in a Microsoft Word document do the following:

1. Go to File > Options > Save

2. Click embed fonts in file

Un-tick do not embed system fonts, because when running in sandbox we do not have access to them.

In my case I was going to edit the file before saving to Pdf and so did not know what other characters would be required.

Save and upload this document to your CRM environment and run your plugin as needed.