The most likely scenario is that you are using Aspose.Words to convert DOC or DOCX documents to PDF. If you are doing this on Linux, then this topic explains how to ensure Aspose.Words renders your documents with best fidelity.
Most of the DOC and DOCX documents that you will convent were probably created by people using Microsoft Word on Windows or Mac OS operating systems. Those people used fonts that were available to them to format the documents. Therefore most fonts that are used by DOC and DOCX documents will be "Windows fonts" or "Office fonts" e.g. the fonts that are installed with Microsoft Windows or with Microsoft Office. These fonts include Arial, Calibri, Cambria, Century Gothic, Courier New, Garamond, Tahoma, Verdana, Wingdings and many others.
The problem is that the abovementioned TrueType fonts are not installed by default on Linux distributions. If you take a typical DOCX document that is formatted with the Cambria font and try to convert it to PDF on Linux, Aspose.Words will use a different font because Cambria is not available. This will cause the resulting PDF to look different compared to the original DOCX.
To make sure that documents converted by Aspose.Words appear as close to the original as possible, you might need to install "Windows fonts" on your Linux system.
There are two main ways to get TrueType fonts on a Linux system:
· Copy .TTF and .TTC files from a Windows machine to your Linux machine.
· Install a TrueType fonts package, such as msttcorefonts.
An easy and quick way is to copy .TTF and .TTC files from the C:\Windows\Fonts directory on a Windows machine to some directory on your Linux machine. You do not need to install or register these fonts on Linux in any way, you just need to specify the location of the fonts using the FontSettings class in Aspose.Words.
As far as we can tell, Microsoft licenses the fonts for anyone to freely use them, but please check the font licensing for yourself.
There is a number of Linux packages that contain Microsoft TrueType fonts that you can download and install onto your Linux machine. The exact steps might be different on different Linux distributions.
· On Ubuntu, go to the Synaptic Package Manager. Find and install the ttf-mscorefonts-installer package.
· On openSUSE, go to Yast2, Software Management. Find and install the fetchmsttfonts package.
· For font packages for other Linux distributions, please search the documentation and the internet.