Peter Menzel wrote:
I want to set FOPs userconfig.xml in the servlet, using these lines:
File userConfigFile = new
File(getServletContext().getResource("/WEB-INF/userconfig.xml").toExternalForm()
);
So check here whether such file exists:
if (userConfigFile.exists())
Otions options = new Options(userConfigFile);
What can I do?
Have you tried something like
getServletContext().getRealPath("/config/userconfig.xml")
Another question: I need the userconfig.xml, because I want to load an
additional font into FOP, which I created from an TTF file, and use these lines
in the userconfig.xml:
...
<fonts>
<font metrics-file="mtcorsiva.xml" kerning="yes">
<font-triplet name="MTCORSIVA" style="normal" weight="normal">
</font>
...
I put the fonts xml file in the same dir as userconfig.xml. Is the correct?
No, you have to set up baseDir or fontBaseDir properties to resolve
relative pathes. See faq: http://xml.apache.org/fop/faq.html#faq-N102DC.
--
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]