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 "Katiyar, Bhawana" <Bh...@workscape.com> on 2002/04/01 23:54:21 UTC

why doesn't fop take relative path for external graphic

Hi! I am trying to include an image using external-graphic element. It doesn't seem to take relative path.
I don't want to specify the absolute path. 
Any clues?

Thanks in advance
Bhawana

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


Re: why doesn't fop take relative path for external graphic

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Katiyar, Bhawana wrote:
> Hi! I am trying to include an image using external-graphic element. It doesn't seem to take relative path.
> I don't want to specify the absolute path. 
The src attribute of the fo:external-graphics element
takes an URI as a value. Relative URIs are resolved
against the baseDir configuration setting. The
command line app by default uses the current working
directory as baseDir. You can also set it in the
userconfig.xml file. If you are using the command
line, be sure either to start it from the proper
directory, or tell it to use a userconfig.xml with
an appropriate setting.
If you are using FOP embedded in some other application,
for example in a servlet, the baseDir is usually
uninitialized. The symptom is a "...NotFound" exception
with a URI that starts with "(null)".
You can set the baseDir in such a situation:
  String baseDir = "url path to base";
  Configuration.put("baseDir", baseDir);
You can also set baseDir in the userconfig.xml and
use it:
   options = new Options(new File("path to userconfig.xml");
Yes, thats all, no further reference to the "options"
variable necessary.

J.Pietschmann






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