Hi! I am generating PDF files (containing images) with Cocoon. Unfortunately the integration of images (external-graphic) works only on windows and only with absolute path descriptions:
How can I get to my apache [root]/images directory? It doesn�t work with "../". I tried a lot of different paths. And why Linux doesnt understand the above presented code. Do I have to use back-slashes? Where exactly? Hope you can help me, Robert.
Thanks for your help! But I cannot find this file or something similar? Do you have an idea? Robert.
author and deputy
Joined: Jul 13, 2001
Originally posted by Robert Jaeger: Thanks for your help! But I cannot find this file or something similar? Do you have an idea? Robert.
Actually that file comes with fop package. If you are using servlet to generate PDF file dynamically for the given xml file... then in your servlet file try to add the following code before you can the Driver object String basepath = file:"+getServletContext().getRealPath("/images"); org.apache.fop.configuration.Configuration.put("baseDir",basepath); this will assign the absolute path to baseDir inspite of windows or unix..
later in your xsl file you can simply call the graphic file name like <fo:external-graphic src = "test.gif"></fo:external-graphic>
subject: RELATIVE PATH from xsl (cocoon) to apache root for external graphics