Cannot embed font in servlet pdf output

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Cannot embed font in servlet pdf output

CRANFORD, CHRIS

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