Hello,
I'm using FOP 0.92beta and am trying to get PDF generator happening within
a servlet (everything is fine in DOS). I have put all my FOP stuff into a
folder "webroot/xsl-fop". I can get the PDF generation to work if I hardcode
the paths for the FopFactory as follows:
fopFactory.setUserConfig(new File("d:/myapp/webroot/xsl-fop/fop.xconf"));
fopFactory.setFontBaseURL("file:///d:/myapp/webroot/xsl-fop/");
But I clearly don't want to do it this way for a war file, I want to use
relative paths, but I can't seem to be able to configure it.The first part
works:
fopFactory.setUserConfig(getServletContext().getRealPath("/xsl-fop/fop.xconf"));
but this doesn't:
fopFactory.setFontBaseURL("/xsl-fop");
Can anyone tell me where I'm going wrong. It must be a simple paths problem
for URL parameter (I've always had difficulties with Tomcat and relative
paths!) I can see in the logs:
INFO - base set to: file:/D:/eclipse321/./
ERROR - Error with base URL "/xsl-fop/"): no protocol: /xsl-fop/
(clearly the base is set incorrectly)
Also, I am not clear why I have to specify the path to the font.xml file
twice, once in the fop.xconf file as follows:
...
<renderers>
<renderer mime="application/pdf">
<filterList>
<value>flate</value>
</filterList>
<fonts>
<font metrics-url="verdana.xml" kerning="yes">
<font-triplet name="Verdana" style="normal" weight="normal"/>
</font>
and again for fopFactory.setFontBaseURL().
Thanks in advance,
sham
_________________________________________________________________
Find accommodation FAST with MSN Search! http://search.msn.ie/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]