Image not available

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Image not available

pjmorce
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
Reply | Threaded
Open this post in threaded view
|

RE: Image not available

Olaf Wentzien
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
Reply | Threaded
Open this post in threaded view
|

RE: Image not available

pjmorce
In reply to this post by pjmorce
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 <[hidden email]
Date: Mon, 15 Feb 2010 17:35:43 +0100
To[hidden email] 
Message-ID: <[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

RE: Image not available

pjmorce
In reply to this post by pjmorce

Sorry, I did not put the entire URL on the email. I already have the "jar:" tag on the URL

Actually the code is :

   StreamSource streamSource = new StreamSource(tu.getxFile().getInputStream());
   String sss = this.getClass().getClassLoader().getResource("img/logo.gif").toExternalForm();
   
   int idxl = sss.lastIndexOf("/");
   String subs1 = sss.substring(0, idxl);
   int idxl2 = subs1.lastIndexOf("/");
   String subs2 = subs1.substring(0, idxl2+1);
   System.out.println("subs2: " + subs2);

=> the result of this subs2 is:

subs2: jar:file:/D:/Programs/apache-tomcat-6.0.24/webapps/PComAutoWS/WEB-INF/lib
/PComTraitementAutomatique.jar!/

   streamSource.setSystemId(subs2);
   Transformer foTrans = tFactoryXML2FO.newTransformer(streamSource);
   Transformer pdfTrans = tFactoryFO2PDF.newTransformer();
   ...


Thanks for the help

Regards



Re: Antwort: RE:: RE: Image not available

From: Jeremias Maerki <[hidden email]
Date: Tue, 16 Feb 2010 15:04:26 +0100
To[hidden email] 
Message-Id: <[hidden email]
I think you're missing the "jar:" in front of the URL:
http://java.sun.com/j2se/1.3/docs/api/java/net/JarURLConnection.html

Note that you can also register a URIResolver with FOP so you can
resolve URIs in a special fashion.

See also:
- http://xmlgraphics.apache.org/fop/0.95/embedding.html#fop-factory
- http://wiki.apache.org/xmlgraphics-fop/HowTo/XmlCommonsResolver

On 16.02.2010 14:49:38 Paulo Carvalho wrote:
> Hi again
> Yes, I tried that but always with the same result (Image not available:
> url(img/logo.gif)
> 
> I tried with :
>   -
> file:/D:/Programs/apache-tomcat-6.0.24/webapps/MyWS/WEB-INF/lib/App.jar!/
> - file:/D:/Programs/apache-tomcat-6.0.24/webapps/MyWS/WEB-INF/lib/App.jar!
> 
> The result has been the same.
> I also tried with that using eclipse for executing/deploying the web service
> and there is no problem. The image is well inserted on the PDF file...
> 
> Thanks
> 
> regards
> 
> 
> Antwort: RE:: RE: Image not available
> 
>    - This message: [ Message
> body<http://lists.w3.org/Archives/Public/www-xsl-fo/2010Feb/0022.html#start22>
> ]
>    [ Respond<[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>
> ]
>    [ More options<http://lists.w3.org/Archives/Public/www-xsl-fo/2010Feb/0022.html#options3>
>     ]
>    - Related messages: [ Previous
> message<http://lists.w3.org/Archives/Public/www-xsl-fo/2010Feb/0021.html>
> ]
>    [ In reply to <http://www.w3.org/mid/E1NhKa7-0007nj-Q7@...> ]
> 
> From: Olaf Wentzien
> <[hidden email]<[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>
> >
> Date: Tue, 16 Feb 2010 13:47:33 +0100
> To: [hidden email]<[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>
> 
> Message-ID: <
> [hidden email]>
> 
> Hi Paolo,
> 
> I think the problem is, that the setSysemId-Method should only get the
> directory from where on the image has to be searched.
> So it should be only :
> 
> file:/D:/Programs/apache-tomcat-6.0.24/webapps/MyWS/WEB-INF/lib/App.jar!/
> 
> from that point img/logo.gif is searched
> 
> Hope that works / Olaf
> 
> 
> >
> > Olaf,
> >
> > I tried with the solution you proposed (I have put the image name
> > hardcoded on my java class)  but the result were the same: the image
> > as not been found.
> >
> > I have put some log messages to control what was happening. Here they
> are:
> >
> > [DEBUG] imagePath: file:/D:/Programs/apache-tomcat-6.0.24/webapps/
> > MyWS/WEB-INF/lib/App.jar!/img/logo.gif
> > [ERROR] Image not available: url(img/logo.gif)
> >
> > In the first list, you can see that mee image is on the img path
> > into the App.jar file. The App.jar file is in the WAR file on my web
> service.
> >
> > Here is the coded I used:
> >
> > StreamSource streamSource = new
> StreamSource(tu.getxFile().getInputStream());
> > String imagePath = this.getClass().getClassLoader().getResource
> > ("img/logo.gif").getPath();
> > LOGGER..debug("imagePath: " + imagePath);
> > streamSource.setSystemId(imagePath);
> > Transformer foTrans = tFactoryXML2FO.newTransformer(streamSource);
> > Transformer pdfTrans = tFactoryFO2PDF.newTransformer();
> >
> > Thank you for your help
> >
> > From: Paulo Carvalho <[hidden email] <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>>
> > Date: Tue, 16 Feb 2010 11:05:30 +0100
> > Message-ID:
> <[hidden email]
> <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>>
> > To: [hidden email] <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>
> >
> > Thanks for your answer.
> >
> > Its indead a solution but the problem is that I dont know the name of my
> > image file. The name of the image file is on the XSL file like this:
> >    <xsl:value-of select="string('img/logo.gif')"/>
> >
> > But I will try to figure out if it is possible to resolve the problem
> using
> > this approach...
> >
> > Regards
> >
> > From: Olaf Wentzien
> > <[hidden email] <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E><[hidden email] <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>?Subject=RE%3A%3A%20RE%3A%
> > 20Image%20not%20available&In-Reply-To=%253COFBD287B26.3E54E39A-
> > ONC12576CC.0032A934-C12576CC.003424C9%40ppi.de%253E&References=%
> >
> 253COFBD287B26.3E54E39A-ONC12576CC.0032A934-C12576CC.003424C9%40ppi.de%253E>
> > >
> > Date: Tue, 16 Feb 2010 10:29:31 +0100
> > To: [hidden email] <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E><[hidden email] <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>?Subject=RE%3A%3A%20RE%3A%
> > 20Image%20not%20available&In-Reply-To=%253COFBD287B26.3E54E39A-
> > ONC12576CC.0032A934-C12576CC.003424C9%40ppi.de%253E&References=%
> >
> 253COFBD287B26.3E54E39A-ONC12576CC.0032A934-C12576CC.003424C9%40ppi.de%253E>
> >
> > Message-ID: <
> > [hidden email] <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>>
> >
> > Hi ,
> >
> > how about something like that:
> >
> >
> > .....
> > StreamSource streamSource = new StreamSource
> > (tu.getxFile().getInputStream());
> > String imagePath = this.getClass().getClassLoader().getResource(
> > "your-image-file").getPath();
> > streamSource.setSystemId(imagePath);
> >
> > Transformer foTrans = tFactoryXML2FO.newTransformer(streamSource);
> > Transformer pdfTrans = tFactoryFO2PDF.newTransformer();
> > .....
> >
> >
> > >
> > > 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 <[hidden email] <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E> <[hidden email] <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>?
> > Subject=RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%
> > 253COFBD287B26..3E54E39A-ONC12576CC.0032A934-C12576CC.003424C9%40ppi.de
> > %253E&References=%253COFBD287B26.3E54E39A-ONC12576CC.0032A934-
> > C12576CC.003424C9%40ppi.de%253E>>
> > > Date: Mon, 15 Feb 2010 17:35:43 +0100
> > > To: [hidden email] <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E> <[hidden email] <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>?Subject=RE%3A%3A%20RE%3A%
> > 20Image%20not%20available&In-Reply-To=%253COFBD287B26.3E54E39A-
> > ONC12576CC.0032A934-C12576CC.003424C9%40ppi.de%253E&References=%
> >
> 253COFBD287B26.3E54E39A-ONC12576CC.0032A934-C12576CC.003424C9%40ppi.de%253E>
> > > Message-ID:
> > <[hidden email] <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>
> > <[hidden email] <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>?
> > Subject=RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%
> > 253COFBD287B26..3E54E39A-ONC12576CC.0032A934-C12576CC.003424C9%40ppi.de
> > %253E&References=%253COFBD287B26.3E54E39A-ONC12576CC.0032A934-
> > C12576CC.003424C9%40ppi.de%253E>
> > > >
> > >
> > > 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 09:30:06 GMT
> >
> >    - This message: [ Message
> > body<http://lists.w3.org/Archives/Public/www-xsl-fo/2010Feb/0019.html#start19>
> >     ]
> >    - Previous message: Paulo Carvalho: "RE: Image not
> > available"<http://lists.w3.org/Archives/Public/www-xsl-fo/2010Feb/0018.html>
> >    - In reply to: [ message archived in another list or
> > period<http://www.w3.org/mid/E1NhHlD-0003Bz-CE@frink.w3..org>
> >     ]
> >
> >
> >    - Mail actions: [ respond to this
> > message<[hidden email] <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>?Subject=RE%3A%3A%20RE%3A%20Image%20not%
> > 20available&In-Reply-To=%253COFBD287B26.3E54E39A-ONC12576CC.
> > 0032A934-C12576CC.003424C9%40ppi.de%253E&References=%253COFBD287B26.
> > 3E54E39A-ONC12576CC.0032A934-C12576CC.003424C9%40ppi.de%253E>
> > ]
> >    [ mail a new topic <[hidden email] <[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>> ]
> >    - Contemporary messages sorted: [ by
> > date<http://lists.w3.org/Archives/Public/www-xsl-fo/2010Feb/index.html#msg19>
> > ]
> >    [ by thread<http://lists.w3.org/Archives/Public/www-xsl-fo/
> > 2010Feb/thread.html#msg19>
> > ]
> >    [ by subject<http://lists.w3.org/Archives/Public/www-xsl-fo/
> > 2010Feb/subject.html#msg19>
> > ]
> >    [ by author<http://lists.w3.org/Archives/Public/www-xsl-fo/
> > 2010Feb/author.html#msg19>
> >     ]
> >    - Help: [ How to use the archives <http://lists.w3.org/Help/> ] [
> Search
> >    in the archives<http://www.w3.org/Search/Mail/Public/search?type-
> > index=www-xsl-fo&index-type=t>
> >     ]
> >
> >
> > --
> > 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 10:14:41 GMT
> >
> > --
> > 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 12:48:08 GMT
> 
>    - This message: [ Message
> body<http://lists.w3.org/Archives/Public/www-xsl-fo/2010Feb/0022.html#start22>
>     ]
>    - Previous message: Paulo Carvalho: "RE:: RE: Image not
> available"<http://lists.w3.org/Archives/Public/www-xsl-fo/2010Feb/0021.html>
>    - In reply to: [ message archived in another list or
> period<http://www.w3.org/mid/E1NhKa7-0007nj-Q7@...>
>     ]
> 
> 
>    - Mail actions: [ respond to this
> message<[hidden email]?Subject=Re%3A%20Antwort%3A%20RE%3A%3A%20RE%3A%20Image%20not%20available&In-Reply-To=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E&References=%253COF05733CC9.72511AB0-ONC12576CC.0045DF12-C12576CC.0046466E%40ppi.de%253E>
> ]
>    [ mail a new topic <[hidden email]> ]
>    - Contemporary messages sorted: [ by
> date<http://lists.w3.org/Archives/Public/www-xsl-fo/2010Feb/index.html#msg22>
> ]
>    [ by thread<http://lists.w3.org/Archives/Public/www-xsl-fo/2010Feb/thread.html#msg22>
> ]
>    [ by subject<http://lists.w3.org/Archives/Public/www-xsl-fo/2010Feb/subject.html#msg22>
> ]
>    [ by author<http://lists.w3.org/Archives/Public/www-xsl-fo/2010Feb/author.html#msg22>
>     ]
>    - Help: [ How to use the archives <http://lists.w3.org/Help/> ] [ Search
>    in the archives<http://www.w3.org/Search/Mail/Public/search?type-index=www-xsl-fo&index-type=t>
>     ]
> 
> 
> -- 
> Paulo Carvalho
> 1 rue du Chateau
> 57710 Aumetz
> France
> http://forum-informatico.forumeiros.com/index.htm
> http://ummundoecologico.blogspot.com




Jeremias Maerki
Received on Tuesday, 16 February 2010 14:04:40 GMT

--
Paulo Carvalho
1 rue du Chateau
57710 Aumetz
France
http://forum-informatico.forumeiros.com/index.htm
http://ummundoecologico.blogspot.com
Reply | Threaded
Open this post in threaded view
|

Re: Re: Image not available

pjmorce
In reply to this post by pjmorce
Hello again

Just for info, I was using fop093 and I switched to fop095, but without any improvements.
The application still cant find the image...

Thanks
Regards

On Mon, Feb 15, 2010 at 3:01 PM, Paulo Carvalho <[hidden email]> wrote:
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Image not available

Dave Pawson-2
On 17 February 2010 08:11, Paulo Carvalho <[hidden email]> wrote:
> Hello again
> Just for info, I was using fop093 and I switched to fop095, but without any
> improvements.
> The application still cant find the image...

Or the image isn't in the relative location that you specify?
Have you tried an absolute reference?


regarsd




--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

Reply | Threaded
Open this post in threaded view
|

Re: Re: Image not available

pjmorce
Hello

Thanks for your answer.
No, the image is in the correct path and the name is also correct. The image is on a Jar file named App.jar and has the name logo.gif. It is on the "img" path into the jar file.

When I set the systemId on the StreamSource, the value is:

jar:file:/D:/Programs/apache-tomcat-6.0.24/webapps/MyWS/WEB-INF/lib
/App.jar!/
(Code:
String sss = this.getClass().getClassLoader().getResource("img/cnpf.gif").toExternalForm();
int idxl = sss.lastIndexOf("/");
String subs1 = sss.substring(0, idxl);
int idxl2 = subs1.lastIndexOf("/");
String subs2 = subs1.substring(0, idxl2+1);
System.out.println("subs2: " + subs2);
streamSource.setSystemId(subs2);
Transformer foTrans = tFactoryXML2FO.newTransformer(streamSource);
...
)
Note1: The problem only occurs when I build a war on my web service and i deploy it using the command line, on my tomcat server.
If i use eclipse to deploy my web service, the problem does not occur. The image is found into the jar file.

Note2: when my web service is deployed without using eclipse, the problem occurs. But if i put the img folder on the tomcat root directory, the image is found.



Thank you

Regards


On Wed, Feb 17, 2010 at 9:22 AM, Dave Pawson <[hidden email]> wrote:
On 17 February 2010 08:11, Paulo Carvalho <[hidden email]> wrote:
> Hello again
> Just for info, I was using fop093 and I switched to fop095, but without any
> improvements.
> The application still cant find the image...

Or the image isn't in the relative location that you specify?
Have you tried an absolute reference?


regarsd




--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk



--
Paulo Carvalho
1 rue du Chateau
57710 Aumetz
France
http://forum-informatico.forumeiros.com/index.htm
http://ummundoecologico.blogspot.com
Reply | Threaded
Open this post in threaded view
|

Re: Image not available

Jeremias Maerki-2
In reply to this post by pjmorce
Just verified the following with Apache FOP 0.95:
    <fo:flow flow-name="xsl-region-body">
      <fo:block>Hello World!</fo:block>
      <fo:block><fo:external-graphic src="jar:file:///C:/Dev/FOP/main/trunk-clean/build/fop.jar!/org/apache/fop/render/awt/viewer/images/fop.gif"/></fo:block>
    </fo:flow>

Worked fine for me. So JAR URLs should work in principle.

On 17.02.2010 09:11:14 Paulo Carvalho wrote:

> Hello again
>
> Just for info, I was using fop093 and I switched to fop095, but without any
> improvements.
> The application still cant find the image...
>
> Thanks
> Regards
>
> On Mon, Feb 15, 2010 at 3:01 PM, Paulo Carvalho <[hidden email]>wrote:
>
> > 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




Jeremias Maerki


Reply | Threaded
Open this post in threaded view
|

Re: Image not available

Jeremias Maerki-2
In reply to this post by pjmorce
What's the goal? To access images bundled with the web application? In
that case I'd define a private kind of URI which you handle within a
URIResolver that uses getClass().getClassLoader().getResourceAsStream(....
to access the files. You can then use the URIResolver for both XSLT and
FO transformations. An XML Catalog can help during development.

See also:
- http://markmail.org/message/mxv4lx562lyhexza (private URIResolver)
- http://markmail.org/message/i7nvi65adokdemxu (XML Catalog with FOP)

On 17.02.2010 09:29:50 Paulo Carvalho wrote:

> Hello
>
> Thanks for your answer.
> No, the image is in the correct path and the name is also correct. The image
> is on a Jar file named App.jar and has the name logo.gif. It is on the "img"
> path into the jar file.
>
> When I set the systemId on the StreamSource, the value is:
>
> jar:file:/D:/Programs/apache-tomcat-6.0.24/webapps/MyWS/WEB-INF/lib
> /App.jar!/
>
> (Code:
>
> String sss = this.getClass().getClassLoader().getResource("img/cnpf.gif").toExternalForm();
>
> int idxl = sss.lastIndexOf("/");
> String subs1 = sss.substring(0, idxl);
> int idxl2 = subs1.lastIndexOf("/");
> String subs2 = subs1.substring(0, idxl2+1);
> System.out.println("subs2: " + subs2);
>
> streamSource.setSystemId(subs2);
>
> Transformer foTrans = tFactoryXML2FO.newTransformer(streamSource);
>
> ...
>
> )
>
> Note1: The problem only occurs when I build a war on my web service and i
> deploy it using the command line, on my tomcat server.
> If i use eclipse to deploy my web service, the problem does not occur. The
> image is found into the jar file.
>
> Note2: when my web service is deployed without using eclipse, the problem
> occurs. But if i put the img folder on the tomcat root directory, the image
> is found.
>
>
>
> Thank you
>
> Regards
>
>
> On Wed, Feb 17, 2010 at 9:22 AM, Dave Pawson <[hidden email]> wrote:
>
> > On 17 February 2010 08:11, Paulo Carvalho <[hidden email]> wrote:
> > > Hello again
> > > Just for info, I was using fop093 and I switched to fop095, but without
> > any
> > > improvements.
> > > The application still cant find the image...
> >
> > Or the image isn't in the relative location that you specify?
> > Have you tried an absolute reference?
> >
> >
> > regarsd
> >
> >
> >
> >
> > --
> > Dave Pawson
> > XSLT XSL-FO FAQ.
> > Docbook FAQ.
> > http://www.dpawson.co.uk
> >
>
>
>
> --
> Paulo Carvalho
> 1 rue du Chateau
> 57710 Aumetz
> France
> http://forum-informatico.forumeiros.com/index.htm
> http://ummundoecologico.blogspot.com




Jeremias Maerki


Reply | Threaded
Open this post in threaded view
|

RE: Re: Image not available

pjmorce
In reply to this post by pjmorce

Hello

Maybe I have a clue.

(Just to remind, my web service use FO to transform a XML into a PDF)

In the XML to FO transformation step, I logged the FO generated. In the part where the image should appear the text is the following one:

<fo:table-cell padding="0" text-align="left" display-align="center">
  <fo:block>
    <fo:external-graphic src="url(img/logo.gif)"/>
  </fo:block>
</fo:table-cell>

But it should be something like this no?

<fo:table-cell padding="0" text-align="left" display-align="center">
  <fo:block>
    <fo:external-graphic src="url(jar:file:/D:/Programs/apache-tomcat-6.0.24/webapps/MyWS/WEB-INF/lib/App.jar!/img/logo.gif)"/>
  </fo:block>
</fo:table-cell>

"jar:file:/D:/Programs/apache-tomcat-6.0.24/webapps/MyWS/WEB-INF/lib/App.jar!/" is the string used as SystemID for the streamsource used in the FO transformation... (string subs2 in the following code)


String sss = this.getClass().getClassLoader().getResource("img/cnpf.gif").toExternalForm();
int idxl = sss.lastIndexOf("/");
String subs1 = sss.substring(0, idxl);
int idxl2 = subs1.lastIndexOf("/");
String subs2 = subs1.substring(0, idxl2+1);
streamSource.setSystemId(subs2);
Transformer foTrans = tFactoryXML2FO.newTransformer(streamSource);


Re: Image not available

From: Jeremias Maerki <[hidden email]
Date: Wed, 17 Feb 2010 09:32:45 +0100
To[hidden email] 
Message-Id: <[hidden email]
Just verified the following with Apache FOP 0.95:
    <fo:flow flow-name="xsl-region-body">
      <fo:block>Hello World!</fo:block>
      <fo:block><fo:external-graphic src="jar:file:///C:/Dev/FOP/main/trunk-clean/build/fop.jar!/org/apache/fop/render/awt/viewer/images/fop.gif"/></fo:block>
    </fo:flow>

Worked fine for me. So JAR URLs should work in principle.

On 17.02.2010 09:11:14 Paulo Carvalho wrote:
> Hello again
> 
> Just for info, I was using fop093 and I switched to fop095, but without any
> improvements.
> The application still cant find the image...
> 
> Thanks
> Regards
> 
> On Mon, Feb 15, 2010 at 3:01 PM, Paulo Carvalho <[hidden email]>wrote:
> 
> > 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




Jeremias Maerki
Received on Wednesday, 17 February 2010 08:33:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 17 February 2010 08:33:16 GMT


--
Paulo Carvalho
1 rue du Chateau
57710 Aumetz
France
http://forum-informatico.forumeiros.com/index.htm
http://ummundoecologico.blogspot.com
Reply | Threaded
Open this post in threaded view
|

Re: Re: Image not available

Dave Pawson-2
On 17 February 2010 08:59, Paulo Carvalho <[hidden email]> wrote:

> Hello
>
> Maybe I have a clue.
> (Just to remind, my web service use FO to transform a XML into a PDF)
> In the XML to FO transformation step, I logged the FO generated. In the part
> where the image should appear the text is the following one:
> <fo:table-cell padding="0" text-align="left" display-align="center">
>   <fo:block>
>     <fo:external-graphic src="url(img/logo.gif)"/>
>   </fo:block>
> </fo:table-cell>

Standard xsl-fo. Yes. with the image in a file, in directory img,
relative to the stylesheet.


> But it should be something like this no?
> <fo:table-cell padding="0" text-align="left" display-align="center">
>   <fo:block>
>     <fo:external-graphic
> src="url(jar:file:/D:/Programs/apache-tomcat-6.0.24/webapps/MyWS/WEB-INF/lib/App.jar!/img/logo.gif)"/>
>   </fo:block>
> </fo:table-cell>
> "jar:file:/D:/Programs/apache-tomcat-6.0.24/webapps/MyWS/WEB-INF/lib/App.jar!/"
> is the string used as SystemID for the streamsource used in the FO
> transformation... (string subs2 in the following code)


AFAIK, the expression jar:file:/D:  is invalid as far as
http://tools.ietf.org/html/rfc3986
is concerned, i.e. there is no such schema as jar:

It may have been added by some XSLT engines, possibly some xsl-fo engines too,
but it is still invalid as far as XSLT is concerned, i.e. this expression
is not portable.


regards



--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

Reply | Threaded
Open this post in threaded view
|

Re: Re: Image not available

pjmorce


On Wed, Feb 17, 2010 at 10:38 AM, Dave Pawson <[hidden email]> wrote:
On 17 February 2010 08:59, Paulo Carvalho <[hidden email]> wrote:
> Hello
>
> Maybe I have a clue.
> (Just to remind, my web service use FO to transform a XML into a PDF)
> In the XML to FO transformation step, I logged the FO generated. In the part
> where the image should appear the text is the following one:
> <fo:table-cell padding="0" text-align="left" display-align="center">
>   <fo:block>
>     <fo:external-graphic src="url(img/logo.gif)"/>
>   </fo:block>
> </fo:table-cell>

Standard xsl-fo. Yes. with the image in a file, in directory img,
relative to the stylesheet.

=> The XSL stylesheet comes from a Database. It is not on the file system. My image file is on a JAR file which is on the WAR file on my web service. File name and path of the image are correct on the JAR file.

 


> But it should be something like this no?
> <fo:table-cell padding="0" text-align="left" display-align="center">
>   <fo:block>
>     <fo:external-graphic
> src="url(jar:file:/D:/Programs/apache-tomcat-6.0.24/webapps/MyWS/WEB-INF/lib/App.jar!/img/logo.gif)"/>
>   </fo:block>
> </fo:table-cell>
> "jar:file:/D:/Programs/apache-tomcat-6.0.24/webapps/MyWS/WEB-INF/lib/App.jar!/"
> is the string used as SystemID for the streamsource used in the FO
> transformation... (string subs2 in the following code)


AFAIK, the expression jar:file:/D:  is invalid as far as
http://tools.ietf.org/html/rfc3986
is concerned, i.e. there is no such schema as jar:

It may have been added by some XSLT engines, possibly some xsl-fo engines too,
but it is still invalid as far as XSLT is concerned, i.e. this expression
is not portable.

=> I tried with 

jar:file:///D:/Programs/apache-tomcat-6.0.24/webapps/MyWS/WEB-INF/lib/App.jar!/
instead of
jar:file:/D:/Programs/apache-tomcat-6.0.24/webapps/MyWS/WEB-INF/lib/App.jar!/

And it still does not work....


I'm lost...
 


regards



--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk



--
Paulo Carvalho
1 rue du Chateau
57710 Aumetz
France
http://forum-informatico.forumeiros.com/index.htm
http://ummundoecologico.blogspot.com
Reply | Threaded
Open this post in threaded view
|

Re: Re: Image not available

Dave Pawson-2
On 17 February 2010 11:38, Paulo Carvalho <[hidden email]> wrote:

> => The XSL stylesheet comes from a Database. It is not on the file system.
> My image file is on a JAR file which is on the WAR file on my web service.
> File name and path of the image are correct on the JAR file.

In which case you are on your own and outside the W3C recommendation?

Try it first with the stylesheet available on disk, with the img directory
in the same directory as the stylesheet, image within ./img
then see if it works.

that way is 'as expected' by the rec.

btw, this thread is more suitable for the XSLT mailing list
at www.mulberrytech.com



--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

Reply | Threaded
Open this post in threaded view
|

Re: Re: Image not available

pjmorce
Hi again

I used a simple example on the Internet about how to use FOP in java (http://javaboutique.internet.com/tutorials/FOP/) :

  - I Created a simple Java application with a class that takes an XML and converts it into a PDF (using a XSL) containing an image. The name of my class is Process.java and it has a method "process"

  - I Created a simple web service that just call this "process" method of that class.

Here is the code of my Process.java class:

  public static String process(String xml, String xsl) {
String sResult = null;
try {

ByteArrayOutputStream foOut = new ByteArrayOutputStream();
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
InputStream iss = Process.class.getClassLoader().getResourceAsStream(brique);
copyFile(new BufferedInputStream(iss), bOut);
SAXBuilder builder = new SAXBuilder();
Document document = builder.build(new ByteArrayInputStream(xml.getBytes()));
TransformerFactory factory = TransformerFactory.newInstance();
InputStream iXsl = Process.class.getClassLoader().getResourceAsStream(xsl);
StreamSource iSource = new StreamSource(iXsl);
Transformer foTrans = factory.newTransformer(iSource);
StreamSource strSourceXML = new StreamSource(new ByteArrayInputStream(xml.getBytes()));
foTrans.transform(strSourceXML, new StreamResult(foOut));
foOut.flush();
ByteArrayOutputStream pdfOut = new ByteArrayOutputStream();
TransformerFactory tFactoryFO2PDF = TransformerFactory.newInstance();
Transformer pdfTrans = tFactoryFO2PDF.newTransformer();
FopFactory fopFactory = FopFactory.newInstance();
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, pdfOut);
Result res = new SAXResult(fop.getDefaultHandler());
StreamSource streamSourceXml = new StreamSource(new ByteArrayInputStream(foOut.toByteArray()));
pdfTrans.transform(streamSourceXml, res);
java.io.File file = new java.io.File("d:/res.pdf");
FileOutputStream foStream = new FileOutputStream(file);
pdfOut.writeTo(foStream);
} catch(Exception e) {
e.printStackTrace();
}
return sResult;
}
private static boolean copyFile(InputStream in, OutputStream out) {
try {

int c;
while ((c = in.read()) != -1)
out.write(c);

in.close();
out.close();
} catch (IOException io) {
return false;
}
return true;
}


The code of my web service is just:

public static String process(String xml, String xsl) {
String sResult = null;
try {
sResult = Process.process(xml, xsl);
System.out.println("sss");
} catch(Exception e) {
e.printStackTrace();
}
return sResult;
}

The web service has the JAR of the Java application in his classpath. The content of the Jar file is the following one:
      Name            Path
briques.xsd          
logo.gif                 img\
Manifest.mf          meta-inf\
Process.class      tst
saxon-licence.lic  
xsl2.xslt

I call the web service with the following parameters:

xml = "<?xml version='1.0' encoding='UTF-8'?>"+
"<Catalog>"+
"<Book>"+
"<Title>Mastering EJB</Title>"+
"<Author>Ed Roman</Author>"+
"<Price>$45.00</Price>"+
"</Book>"+
"<Book>"+
"<Title>Design Patterns</Title>"+
"<Author>Erich Gamma</Author>"+
"<Price>$50.00</Price>"+
"</Book>"+
"<Book>"+
"<Title>Effective Java</Title>"+
"<Author>Josch Bloch</Author>"+
"<Price>$30.00</Price>"+
"</Book>" +
"</Catalog>";

xsl = "xsl2.xslt";

In the xsl2.xslt I have a part of code like this to insert the image on the pdf:
...
<fo:block>
  <fo:external-graphic src="img/logo.gif"/>
</fo:block>
...


The XSL is found in the JAR because the PDF file is generated. But the following error still appearing and the image is not inserted on the PDF:
[ERROR] Image not found: img/logo.gif

What am I doing wrong?

Thanks
Regards



On Wed, Feb 17, 2010 at 1:20 PM, Dave Pawson <[hidden email]> wrote:
On 17 February 2010 11:38, Paulo Carvalho <[hidden email]> wrote:

> => The XSL stylesheet comes from a Database. It is not on the file system.
> My image file is on a JAR file which is on the WAR file on my web service.
> File name and path of the image are correct on the JAR file.

In which case you are on your own and outside the W3C recommendation?

Try it first with the stylesheet available on disk, with the img directory
in the same directory as the stylesheet, image within ./img
then see if it works.

that way is 'as expected' by the rec.

btw, this thread is more suitable for the XSLT mailing list
at www.mulberrytech.com



--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk



--
Paulo Carvalho
1 rue du Chateau
57710 Aumetz
France
http://forum-informatico.forumeiros.com/index.htm
http://ummundoecologico.blogspot.com

1.PNG (49K) Download Attachment