xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jerome Munchenberg" <Jerome.Munchenb...@intecgroup.com.au>
Subject RE: Help! URI for fo:external-graphic in web service
Date Tue, 08 Jan 2008 01:57:06 GMT
Abel,

Thanks for such a comprehensive response! Much appreciated.

In the end it all got too hard, and after much experimentation, I
embedded the GIF in the XSL-FO using BASE64 encoding.

  <fo:external-graphic
	width="70mm"
	content-height="scale-to-fit"
	content-width="scale-to-fit"
	src="data:image/gif;base64,R0lGODlhhAl...
  ..."/>

Worked a treat...

Regards,

Jerome

-----Original Message-----
From: Abel Braaksma [mailto:abel.online@xs4all.nl] 
Sent: Monday, 7 January 2008 12:59 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Help! URI for fo:external-graphic in web service

Jerome Munchenberg wrote:
> Hello,
>
> I am developing a web service which returns a PDF generated by FOP
> (fop-0.94) which must include an image. The web service is deployed as
> an EAR to a WebLogic server, and the image to be inserted into the PDF
> is contained within this EAR.
>   

You might try the JAR scheme, but I am not sure whether that scales well

to a EAR. Another option is to use the real filepath (you can get the 
real unpacked EAR location through your web application server 
interface, I believe), or a relative path (often it is quite easy to get

the WEB-INF directory and go from there).

If all fails, the next easiest thing to do is to use the public URI 
which would also be accessible from your website to retrieve that same 
file. It is probably best to use localhost as server to prevent an extra

server roundtrip.

If you don't like any of these scenarios because of their lack of 
scalability, start using Catalogs (see OASIS website) and use a 
URIResolver (possibly with a specific scheme) to resolve the catalogs 
unambiguously regardless the platform / system / paths your services are

running on.

> How do I correctly access the image embedded in the EAR? I have been
> able to use a file file path when testing on my own box, but this is
> obviously unsuitable for other environments!
>   

You were lucky that it worked, because if a file path is allowed, than 
that's a bug in the FOP implementation: XSL-FO prescribes that only a 
URI is allowed. To go from a filepath to a URI you should rewrite it 
something like "file:///c:/project/scr/certificate.gif" (note the 
forward slashes!).

> src="C:\Project\src\au\com\aaa\services\certificate.gif"

HTH,
Cheers,
-- Abel Braaksma


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


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


Mime
View raw message