Title: URGENT - Adding dynamic, non file system images into a pdf document.

I'm trying to produce a pdf document that contains dynamically generated jpeg images.  The images are available within the session.  I'm using a cocoon pipline match to serialise xsl-fo into pdf documents.

I've explored the following options:

1.) Creating a cocoon servlet to stream back the image data.  This work fine for images within HTML document.  When I reference the servlet from an xsl-fo image source, my session is unavailable and only a new session accessible.

2.) Create a cocoon generator to turn jpeg image binary into a base64 encoded string and embed this string within an instream-foreign-object using svg.  This method produces visible images, but the final pdf document is huge.  It's like the jpeg compression is being translated into an uncompressed bitmap. 

    <fo:instream-foreign-object content-type="content-type:image/jpeg">

      <svg:svg height="176mm" width="277mm">

        <svg:image width="277mm" height="176mm" x="0" y="0" xlink:href="" /9j/4AAQSkZJRgABAQAAAQAgLCgoL . . . ." />

      </svg:svg>

    </fo:instream-foreign-object>

I've already spent too much time trying to get this working.  I've found some references to this type of issue in other mail archives, but the responses I've seen have been very vague.   I'll be forced to drop using pdf reports and use ugly html if I can't resolve this very soon. 

If anyone has a solution that they have tried, please let me know.  I'd hate to abandon fop and produce nasty html reports after getting this far!

Please help

Craig.

Reply via email to