You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by cl...@pg.ebx.com on 2000/10/31 11:37:12 UTC

Failed to load image with external-graphic

Hi,

I faced problem in loading image.

I had been set CLASSPATH=C:\Jimi.jar;C:\xalan\xalan.jar;C:
\xalan\xerces.jar;C:\xalan\bsf.jar;C:\fop\fop-0_14_0\fop_bin_0_14_0.jar;C:
\fop\fop-0_14_0\lib\w3c.jar;

In my XSL file,
<fo:block>
  <fo:external-graphic
    src="file:abc.gif"/>
</fo:block>

My abc.gif file is putting in the same folder where I execute the below
commands :
java org.apache.xalan.xslt.Process -in graphic.xml -xsl graphic.xsl -out
graphic.fo
java org.apache.fop.apps.CommandLine graphic.fo graphic.pdf

After I execute the above commands, I get the below :
FOP-0_14_0
using SAX parser org.apache.xerces.parsers.SAXParser
using renderer org.apache.fop.render.pdf.PDFRenderer
using element mapping org.apache.fop.fo.StandardElementMapping
using element mapping org.apache.fop.svg.SVGElementMapping
using property list mapping org.apache.fop.fo.StandardPropertyListMapping
using property list mapping org.apache.fop.svg.SVGPropertyListMapping
building formatting object tree
setting up fonts
formatting FOs into areas
 [1Error while creating area : Error while loading image file:/abc.gif
 : class java.lang.Exception - Image error
]
rendering areas to PDF
writing out PDF

What is the problem ? Can someone please give me help ? Thank you.

Regards,
cllai.


Re: Failed to load image with external-graphic

Posted by Richard Huxton <de...@archonet.com>.
From: <cl...@pg.ebx.com>
> In my XSL file,
> <fo:block>
>   <fo:external-graphic
>     src="file:abc.gif"/>
> </fo:block>
>
[snip]
> formatting FOs into areas
>  [1Error while creating area : Error while loading image file:/abc.gif
                                                               ^^^
For some reason you're getting an absolute path here. I can't reproduce this
on FOP-0_14_0 on linux with IBM's JDK 1.3 (I hacked images.fo in the
examples to test it)

>  : class java.lang.Exception - Image error
> ]
> rendering areas to PDF
> writing out PDF
>
> What is the problem ? Can someone please give me help ? Thank you.
>
> Regards,
> cllai.
>
>
>
Does the .fo file have that leading slash on abc.gif? If not, check versions
of your .jar files.
Or - could be a PC thing - try specifying a path as "file:./abc.gif" - does
that change anything?

HTH

- Richard Huxton