W3C home > Mailing lists > Public > www-xsl-fo@w3.org > February 2010

RE: Image not available

From: Paulo Carvalho <pjcarvalho@gmail.com>
Date: Tue, 16 Feb 2010 08:20:28 +0100
Message-ID: <8f151cff1002152320h1bedc1a8n39546761798e936d@mail.gmail.com>
To: www-xsl-fo@w3.org
Hello Olaf
Thanks for your answer. The problem is that my XSL comes from a table on a
database, so it is not in the jar file. I get it from the DB into a byte[]
and gets a StreamSource from it...
....Transformer foTrans = tFactoryXML2FO.newTransformer(new
StreamSource(tu.getxFile().getInputStream()));Transformer pdfTrans =
tFactoryFO2PDF.newTransformer();...
Any other idea?
Thanks
best regards


From: Olaf Wentzien
<olaf.wentzien@ppi.de<olaf.wentzien@ppi.de?Subject=RE%3A%20Image%20not%20available&In-Reply-To=%253COFBE28BA44.3FE0A418-ONC12576CB.005A440C-C12576CB.005B2966%40ppi.de%253E&References=%253COFBE28BA44.3FE0A418-ONC12576CB.005A440C-C12576CB.005B2966%40ppi.de%253E>
>
Date: Mon, 15 Feb 2010 17:35:43 +0100
To: www-xsl-fo@w3.org<www-xsl-fo@w3.org?Subject=RE%3A%20Image%20not%20available&In-Reply-To=%253COFBE28BA44.3FE0A418-ONC12576CB.005A440C-C12576CB.005B2966%40ppi.de%253E&References=%253COFBE28BA44.3FE0A418-ONC12576CB.005A440C-C12576CB.005B2966%40ppi.de%253E>

Message-ID: <
OFBE28BA44.3FE0A418-ONC12576CB.005A440C-C12576CB.005B2966@ppi.de>

Hi,

I guess you have to tell FOP - before calling the rendering process - from
wich point it shall resolve filenames.

try doing this with:

        xslSource.setSystemId(xslUrl.toExternalForm());


where xslSource is the XML-Input file and
xslUrl is the style-sheet-file - assuming that your stylesheet is in the
same jar-file as your image and that is has a location from where you can
find your image using a relative path


Regards Olaf


>
> Hello
>
> I have a web service that uses a jar application file (that i
> built). This application jar file transforms a XML into a PDF using
> FOP. The XML file as some text and also the path/name of an image
> file that is also into the jar file.
>
> When i execute the web service, using eclipse/tomcat deployment,
> everything is executed ok. The PDF is well generated and the image
> (the header of the pdf file) is correctly on the pdf document.
>
> Now, I build a WAR file to deploy my web service on a server.. The
> WAR contains correctly the JAR file with the image file.
> When i deploy the WAR file without eclipse, using only the classical
> command line and I test it, the PDF is generated correctly but
> without the image that constitues is header. The following error :
>    "2010-02-15 14:27:29,267 ERROR org.apache.fop.fo.FONode -
> ExternalGraphic.java:70 - Image not available: url(img\\head.gif)"
> is generated
>
> Is it a problem of FOP? Can you please help me to resolve this problem?
>
> thanks
>
> Best regards
>
> --
> Paulo Carvalho
> 1 rue du Chateau
> 57710 Aumetz
> France
> http://forum-informatico.forumeiros.com/index.htm
> http://ummundoecologico.blogspot.com


-- 
Paulo Carvalho
1 rue du Chateau
57710 Aumetz
France
http://forum-informatico.forumeiros.com/index.htm
http://ummundoecologico.blogspot.com
Received on Tuesday, 16 February 2010 07:22:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 16 February 2010 07:22:18 GMT