Setting path to fonts

Hi,


we are currently using Aspose.Pdf for Java to programmatically add some signature fields on the PDF documents generated by our web application.

Such web-app runs on a Tomcat 7 server on JDK 7 under security manager.

I’ve noticed that, while running on a CentOS 5.8 box, the library seems to try to look for the fonts in C:\WINDOWS\Fonts, which clearly cannot exist, and also causes an exception in the security manager since tomcat has no access to that folder.

Is there a way to “tell” the library where the fonts actually are? I noticed that there is such feature for Aspose.Words for Java (http://www.aspose.com/docs/display/wordsjava/How+to++Specify+True+Type+Fonts+Location), but I cannot find its equivalent here.

We would appreciate such functionality since our web-app uses fonts placed in custom folders…

Hi Matteo,


Thanks for your inquiry. I’m afraid the functionality is not available in Aspose.Pdf for Java at the moment. However, I’ve logged an issue as PDFNEWJAVA-33526 for further investigation and resolution. We will keep you updated about issue progress via this forum thread.

Sorry for the inconvenience faced.

Best Regards,

Hi Matteo,


Thanks for your patience.

I am pleased to share that the feature requested earlier to set path to custom fonts folder is implemented in latest release of Aspose.Pdf for Java 4.3.1. Please try using the following methods to accomplish your requirements.

  • Document.getLocalFontPath () - shows the system folder in which our project will look for fonts.
  • Document.setLocalFontPath (String) - Setting font path to custom folder