Re: [xsl] XSL-FO transformation: XSL template packed in a JAR

Subject: Re: [xsl] XSL-FO transformation: XSL template packed in a JAR
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Tue, 19 Jul 2005 22:05:29 +0200
Aitor San Juan wrote:
I have developped a Java class to transform an XML file into a PDF
file using FOP.

...so this question should probably have been sent to the FOP user list (fop-users@xxxxxxxxxxxxxxxxxxxxxx) Anyway:

My Java class, the XSL template and a .gif file (the
image that will appear as the logotype in the header of each page of
the resulting PDF file) are packed in a JAR file.
[snip]
My question: How can I say the FOP processor (or my class, or
whoever) that the .gif file is packed in the JAR?

If you know the absolute path for the jar file, set a jar URL as baseDir. See http://xml.apache.org/fop/configuration.html#summary-key-value http://xml.apache.org/fop/embedding.html#config-external If you don't know the absolute path to the jar file, you can try to use the servlet context's getRealPath("/") or something like that (which is not guaranteed to work as expected).

The FOP user list's archive has some more information regarding
this topic, in particular how to deal with jar URLs.

J.Pietschmann

Current Thread