Try setting the fop configuration.Your base dir isn't
set.So the fop doesn't know where to get the images
from.
(programmatic way):
org.apache.fop.configuration.Configuration.put("baseDir",getServletContext().getRealPath("/images/"));
The above code should be based in your java code
(typically a servlet),just befor calling your main
code that does the fop work.
The same can be set up in properties file too.Do a
google on
org.apache.fop.configuration.Configuration.put or
similar and you'll get tons of info.
The XSL would've something like:
<fo:external-graphic src="checked.jpg"/>
or
<fo:block><fo:external-graphic width="9pt"
height="12pt">
<xsl:attribute name="src" ><xsl:value-of
select="imagename"/></xsl:attribute>
where "imagename" is the xml element (assuming you are
passing the data to xsl in the xml format) that
contains the value "checked.jpg"
Alternate option:
<fo:external-graphic
src="http://myserver/myapp/RenderImageServlet?fileName=File12848910.jpg"
width="9pt" height="12pt"></fo:external-graphic>
Dynamically stream images via a servlet and place that
content into fo:external-graphic as indicated above.
More info at:
http://java.webdeveloper.com/tutorials/FOP/article.html
Pick and choose any option that works for you
Ram
--- macsmaker <[EMAIL PROTECTED]> wrote:
>
> Bear with me, I'm a newbie to FOP. I assure you I
> have search the web, and
> all faqs I can find.
>
> I'm using fop 0.20.5 and I'm trying to display a
> graphic in my PDF. I have
> tried this (and appropriate variations):
>
> <fo:external-graphic
>
src="url('http://myserver/myapp/images/checked.jpg')"/>
>
> I know the graphic is there, and is displayable. I
> don't get any errors.
> The rest of the PDF renders correctly. If I paste
> the url directly in my
> browser the image is rendered correctly.
>
> This does work:
> <fo:external-graphic
> src="url('file:d:///myapp/images/checked.jpg')"/>
>
> I'm sure it's a problem referencing the image, just
> don't know what. I have
> tried different file formats (.gif, .png, etc), no
> difference. Any ideas?
>
> --
> View this message in context:
>
http://www.nabble.com/external-graphic-tf4693880.html#a13416727
> Sent from the FOP - Users mailing list archive at
> Nabble.com.
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]