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

Subject: RE: [xsl] XSL-FO transformation: XSL template packed in a JAR
From: "Aitor San Juan" <asanjuan@xxxxxxxxxxxxxx>
Date: Wed, 20 Jul 2005 16:15:45 +0200
Thanks for your reply, J.Pietschmann.

-----Mensaje original-----
De: J.Pietschmann [mailto:j3322ptm@xxxxxxxx]
Enviado el: martes, 19 de julio de 2005 22:05
Para: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Asunto: Re: [xsl] XSL-FO transformation: XSL template packed in a JAR


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