You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "CRANFORD, CHRIS" <Ch...@setech.com> on 2015/10/23 21:41:45 UTC

Cannot embed font in servlet pdf output

I recently started migrating my FOP 1.1 implementation to 2.0 and I'm having an issue loading a custom font for embedding.  We have all our fonts stored in a "/fonts" directory on the web application's class path.  We used the ServletContextURIResolver in the past and this worked fine, but trying to load our XML configuration and making the necessary 2.0 changes, I continue to have problems loading the fonts.

When specifying the font using embed-url="myFont.ttc":
IllegalArgumentException: URI is not absolute.

When specifying the font using embed-url="servlet-context:///WEB-INF/classes/fonts/myFont.ttc"
                IllegalArgumentException: URI scheme is not "file"

Could someone please clearly explain how I should have my fop.xml defined and loaded in my servlet so that my font is properly loaded.

Thanks,
Chris