PDF Font not same as Word

Hi Team,

We are using PDF convert functions to generate PDF documents from word documents and noticed that the fonts are changing when the document is generated from the openshift servers.
We are not able to install the True fonts considering it requires lots of packages to be installed from external websites.
Do you have some other workaround to resolve this ?

Thanks,
Priyanka

@priyanka9,

Which Aspose for Java API are you using? Are you using Aspose.Words for Java for your task? Also, it would be better if you could zip and share your input Word document and output PDF document to evaluate your issue precisely.

@priyanka9 I am afraid there is no other solution. The fonts are required to build document layout upon conversion to PDF. If Aspose.Words cannot find the font used in the document, the font is substituted. This might lead into fonts mismatch and document layout differences due to the different fonts metrics. You can implement IWarningCallback to get notifications when font substitution is performed.
Please see our documentation to learn where Aspose.Words looks for fonts:
https://docs.aspose.com/words/java/specifying-truetype-fonts-location/

If you have control over the documents creation process you can embed the required fonts into the MS Word document. In this case Aspose.Words will use the embedded fonts for document rendering.

Hi Alex,

We tried installing the fonts inside our Linux servers following the steps defined at Install TrueType Fonts on Linux in C#|Aspose.Words for .NET and then explicitly defining the fonts source as per your suggestion as below -

After doing all these changes, the fonts are still not fixed with PDF.
Pls help us troubleshoot this issue so that we can understand why the fonts are not same as word.

We are using 21.6.3 version of Aspose.

@priyanka9 Have you tried implementing IWarningCallback to check whether font substitution is performed?
Also, please attach your input and output documents here for testing? We will check and provide you more information.

Hi Alex,

Thanks for your help.
We are able to resolve the issue by setting the fonts path.

1 Like