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

Free Support Forum - aspose.com

Font changing during Word to PDF conversion


We are using Aspose.Words ( to generate documents and Aspose.PDF ( for conversion of the generated documents.

We have noticed that text in Gil Sans font gets converted into Times Roman, how do we overcome this problem?




Can you please provide us with the word document that you are having problems with and the code that you are using for conversion.



Please find below the code and a test document.

Any help will be appreciated.


Conversion Code is as follows:

using (MemoryStream itemDocumentStream = new MemoryStream())


using (MemoryStream itemPDFStream = new MemoryStream())


Document itemDocument = AsposeWordsHelper.ConvertBytesToWordDocument(item.GeneratedDocument.Content);

itemDocument.Save(itemDocumentStream, SaveFormat.AsposePdf);

//Create a new pdf converter object

Aspose.Pdf.Pdf pdfConverter = new Aspose.Pdf.Pdf();

// Bind content from the document stream

pdfConverter.BindXML(itemDocumentStream, null);

//This code is needed to ensure performance for documents with bullet points and other formatting

//Fix suggested by aspose.

pdfConverter.IsTruetypeFontMapCached = true;

pdfConverter.TruetypeFontMapPath = _asposeTempPath;

// Save the result to stream


//Now convert the document to byte[]

byte[] documentToReturn = itemPDFStream.ToArray();

return documentToReturn;



I can't reproduce this error.

1) Please make sure the font is correctly installed in your system.

2) If you installed the font after the Aspose.Pdf.TruetypeFontMap.xml being generated in _asposeTempPath, please delete that xml file and let it be regenerated.

3) Try the latest version of Aspose.Words and Aspose.Pdf.