You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Richard Sweeney <Ri...@ncsoft.co.uk> on 2004/01/20 14:41:57 UTC

Including images from a servlet

Hi,

I'm using FOP with a servlet. The servlet generates XML which is then
translated using XSL or, if the user clicks print, will take the XML and
generate a PDF. In the XSL-FO I have an image that appears in the produced
PDF and reference it like so:

<fo:external-graphic src="url(logo.jpg)"/>

if I do it this way though then the image is searched for in the current
directory, usually the Web Server's bin directory, so I usually have to
write it like so:

<fo:external-graphic src="url(path/to/file/logo.jpg)"/>

is there a way to make it search for the image in the current directory,
i.e. the same one as the XSL-FO stylesheet?

Thanks

Richard

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Including images from a servlet

Posted by Chris Bowditch <bo...@hotmail.com>.
Richard Sweeney wrote:

<snip/>

> <fo:external-graphic src="url(path/to/file/logo.jpg)"/>
> 
> is there a way to make it search for the image in the current directory,
> i.e. the same one as the XSL-FO stylesheet?

You can set the base directory for which relative paths will be resolved 
against. This can be done using a configuration file, or set in a 
program. See:

http://xml.apache.org/fop/faq.html#servlet-baseDir

Chris



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org