You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Eric Smith <es...@fruitcom.com> on 2002/07/20 15:34:27 UTC

including encoded image in svg and rendering to pdf

[ no response in batik-users so desperately posting in dev ]

Hi

I followed the instructions in the Pawson fop faq as follows:
<image width="170" height="109" xlink:href="data:image/jpeg;base64,R0lGO...

This renders perfectly in a browser but fails when I try to render with
fop, see below.

I would be real grateful if someone could send me an example of a
graphic embedded in an svg that they have managed to render to pdf.
Ideally I am not looking for the complete svg file but rather just the
node(s) required to embed in some arbitary svg.  Importantly, please
let me know the version number of fop and batik that you used.

Thanx

start of fop error message:


Input mode: FO
fo input file: graphic.fo
Output mode: pdf
output file: /tmp/g.pdf
OPTIONS
user configuration file: /home/eric/userconfig.xml
debug mode on
dump configuration
quiet mode on
reading user configuration file
base directory: file:/home/eric/
FOP 0.20.1
using SAX parser org.apache.xerces.parsers.SAXParser
building formatting object tree
setting up fonts
 [1]Exception in thread "main" java.lang.ExceptionInInitializerError
        at org.apache.batik.ext.awt.image.spi.ImageTagRegistry.getRegistry(ImageTagRegistry.java:218)
        at org.apache.batik.bridge.SVGImageElementBridge.createRasterImageNode(SVGImageElementBridge.java:169)
        at org.apache.batik.bridge.SVGImageElementBridge.createGraphicsNode(SVGImageElementBridge.java:112)
        at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:170)
        at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:136)
        at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:176)
        at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:136)
        at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:69)
        at org.apache.fop.render.pdf.PDFRenderer.renderSVGDocument(PDFRenderer.j

-- 
Eric Smith


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


Re: including encoded image in svg and rendering to pdf - solved

Posted by Eric Smith <es...@fruitcom.com>.
Thomas - very kind of you to answer - thank you - I am happy now -
please see attached for how I solved my problem.

I was very impressed with batik rendering the encoded image
when this is nested in an existing svg file :)

Hopefully when I try to render rotated text this will now be working as well -
my next task.

Thanks for Batik

According to Thomas E Deweese on Tue, Jul 23, 2002 at 07:36:26AM -0400:
> >>>>> "ES" == Eric Smith <es...@fruitcom.com> writes:
> 
> ES> [ no response in batik-users so desperately posting in dev ]
> 
>     Sorry, most of the Batik team was at SVG Open, then the SVG
> working group meeting.
> 
> ES> I followed the instructions in the Pawson fop faq as follows:
> ES> <image width="170" height="109"
> ES> xlink:href="data:image/jpeg;base64,R0lGO...
> 
>     This looks fine to me.
> 
> ES> This renders perfectly in a browser but fails when I try to render
> ES> with fop, see below.
> 
>     When you use the browser I take it that is from a Batik download
> or are you using the Batik jar included with FOP?
> 
> ES> java.lang.ExceptionInInitializerError at
> ES> org.apache.batik.ext.awt.image.spi.ImageTagRegistry.getRegistry(ImageTagRegistry.java:218)
> 
>     This file does not seem to come close to matching what is in Batik
> right now.  So I am unsure about what the problem is. It appears that
> there is something wrong in the bootstrap of the Raster Image handler
> infrastructure.  However since I don't recall ever encountering/fixing
> such a bug in Batik I'm tending to suspect some sort of packaging bug.
> 
>     If at all possible you might try and see if a newer version of FOP
> might reference a newer version of Batik (CVS?).
> 
>     You might also ask on one of the FOP dev lists.


-- 
Eric Smith

including encoded image in svg and rendering to pdf

Posted by Thomas E Deweese <th...@kodak.com>.
>>>>> "ES" == Eric Smith <es...@fruitcom.com> writes:

ES> [ no response in batik-users so desperately posting in dev ]

    Sorry, most of the Batik team was at SVG Open, then the SVG
working group meeting.

ES> I followed the instructions in the Pawson fop faq as follows:
ES> <image width="170" height="109"
ES> xlink:href="data:image/jpeg;base64,R0lGO...

    This looks fine to me.

ES> This renders perfectly in a browser but fails when I try to render
ES> with fop, see below.

    When you use the browser I take it that is from a Batik download
or are you using the Batik jar included with FOP?

ES> java.lang.ExceptionInInitializerError at
ES> org.apache.batik.ext.awt.image.spi.ImageTagRegistry.getRegistry(ImageTagRegistry.java:218)

    This file does not seem to come close to matching what is in Batik
right now.  So I am unsure about what the problem is. It appears that
there is something wrong in the bootstrap of the Raster Image handler
infrastructure.  However since I don't recall ever encountering/fixing
such a bug in Batik I'm tending to suspect some sort of packaging bug.

    If at all possible you might try and see if a newer version of FOP
might reference a newer version of Batik (CVS?).

    You might also ask on one of the FOP dev lists.

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