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 Magnus Rydin <ma...@orionserver.com> on 2002/03/05 23:20:10 UTC

SV: dynamic image in PDF

Am I the only one having problems with including images when running FOP
as part of a J2EE application?
When running FOP stand alone, I can specify the path to my image as per
normal, but when Im running FOP as part of my application I get output
that boils down to that I havent specified a base directory.
Now, going through the API I find no way of setting FOP:s base directory
at runtime, neither how to turn off logging.

Could someone help me out?

It would be awesome if I could give FOP an Image or a byte[] directly,
but just getting file: or url: to work when its part of an application
would do for now.

WR

-----Ursprungligt meddelande-----
Från: Jeremias Maerki [mailto:jeremias.maerki@outline.ch] 
Skickat: den 28 februari 2002 08:20
Till: fop-user@xml.apache.org
Ämne: Re: dynamic image in PDF


> I have a servlet which creates imagery. I want to embed this in a PDF 
> document and I've been playing around with FOP in JSP. I can get PDF 
> generated but only on static image references, using external- 
> graphic. What I need to know is - is there anyway of generating the 
> image dynamically, with the reference to the servlet embedded in the 
> .fo ?
> 
> I can see there is a fo:instream- foreign-object but the examples just

> show examples of SVG. Is there anyway to extend this and if so, 
> doesanyone have examples ?

I haven't tested what you do, but I think you should be able to specify
a full URL with parameters and all in the "src" attribute of
"external-graphic" that will call your servlet to get the image. Or do
you get any error messages?

Cheers,
Jeremias Märki

mailto:jeremias.maerki@outline.ch

OUTLINE AG
Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Fon +41 41 317 20 20 - Fax +41 41 317 20 29
Internet http://www.outline.ch


Re: SV: dynamic image in PDF

Posted by Jeremias Maerki <je...@outline.ch>.
> Am I the only one having problems with including images when running FOP
> as part of a J2EE application?
> When running FOP stand alone, I can specify the path to my image as per
> normal, but when Im running FOP as part of my application I get output
> that boils down to that I havent specified a base directory.
> Now, going through the API I find no way of setting FOP:s base directory
> at runtime, neither how to turn off logging.
> 
> Could someone help me out?
> 
> It would be awesome if I could give FOP an Image or a byte[] directly,
> but just getting file: or url: to work when its part of an application
> would do for now.

You can try to specify a base directory with the following call where
baseDir is an URL String like "file:D:/Temp".

Configuration.put("baseDir", baseDir);

Cheers,
Jeremias Märki

mailto:jeremias.maerki@outline.ch

OUTLINE AG
Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Tel. +41 41 317 2020 - Fax +41 41 317 2029
Internet http://www.outline.ch