xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas DeWeese <Thomas.DeWe...@Kodak.com>
Subject Re: ImageTranscoder problem
Date Mon, 08 Mar 2004 12:27:48 GMT
Brecht Yperman wrote:

> Exporting to svg is no problem.

> For export to JPG, TIF and PNG, i first create a temporary svg file and then
> transcode that file to one of those formats.
> What seems to be the problem:
> the svg file doesn't have width or height attributes. Displaying a 1000*1000
> svg file is no problem, but when I transcode it, it clips the image to the
> upper left 400*400 pixels.
> Is there a way to solve this?

Hi Brecht,

    Yes, simply call 'SVGGraphics2D.setSVGCanvasSize(Dimension  sz)'
with the desired size of the SVG (in your example 1000,1000):

SVGGraphics2D svgGenerator = new SVGGraphics2D(ctx, false);
svgGenerator.setSVGCanvasSize(new Dimension(1000, 1000));

    Also you don't have to write the temporary file.  You can
hand the transcoders a document in memory (It's one of the accepted
types for InputSource) - this saves the time of writing the
SVG and then reparsing it.

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

View raw message