xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoffer Dam Bruun <cdbr...@flyingpigs.dk>
Subject Re: Transcoding SVG to PNG with svg image elements produces "Unable to make sense of URL for connection"
Date Tue, 26 Apr 2011 11:33:01 GMT
Hi,

Have you tried setting the URI on the TranscoderInput ( using setURI() )

If you don't do that Batik will not be able to calculate where it should 
look for
relative path's encountered inside the input SVG.

/Christoffer

On 22-04-2011 17:25, David Padbury wrote:
>
> 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,
>
> David.
>


Mime
View raw message