xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Padbury <dpadb...@liquidnet.com>
Subject Transcoding SVG to PNG with svg image elements produces "Unable to make sense of URL for connection"
Date Fri, 22 Apr 2011 15:25:52 GMT
Hi Everyone,

I'm trying to transcode an SVG with image elements (<image xlink:href="my-image.png" ...
/>). This works great in the command line batik-rasterizer tool when the image is placed
in the current working directory. However when rendering inside my own application (code snippet
below) it is producing the exception "Unable to make sense of URL for connection". The batik-rasterizer
must be providing some method of loading understanding local paths but I haven't been able
to work out how.

Any suggestions?

/* Code snippet in Groovy */
def transcoder = new JPEGTranscoder()

transcoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(1.0));

def reader = new StringReader(svg)
def input = new TranscoderInput(reader)

def output = new TranscoderOutput(outputStream)

transcoder.transcode(input, output)
/* end of snippet */

Kind regards,


View raw message