Skip to Content
Former Member
May 13, 2015 at 12:02 PM

FOP configuration - path to custom fonts


Hi all,

I am using FOP to generate a PDF file. I need to use some custom fonts, so I followed this guide to tell FOP where on the disk to find them.

The guide works perfectly on a standalone FOP instance, while I am not able to replicate the same behavior on the Hybris embedded version, due to a problem with relative paths. It seems that no matter what I configure, I am not able to reach my fonts using a relative path, either to the Hybris bin dir, the fop configuration file dir, the fop lib dir, etc...

The Apache guide says:

Relative URIs for those properties are evaluated relative to the base URI of the configuration file. If the configuration is provided programmatically, the base URI can be set with FopFactory.setUserConfigBaseURI ; default is the current working directory.

I tried different configurations for the fopconfig.xml file; I also tried to customize the fop.config.xml property inside, with no luck.

The only working configuration is the following:

 <fop version="1.0">
     <renderer mime="application/pdf">

But of course I don't want to use an absolute path.

Could someone help me?

Thank you Francesco