xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thierry Kormann <tkorm...@ilog.fr>
Subject Re: request : optimising size of generated PNG by the SVG Rasterizer
Date Mon, 16 Jul 2001 06:57:12 GMT
On Friday 13 July 2001 16:21, Paul Hermans wrote:
> Dear all,
> I'm generating programmatically SVG from an SGML file.
> This is fairly straigthforward except for determining
> the attributes width, heigth and viewport on the svg element.
> as in : <svg width="4in" height="3in" viewBox="0 0 40 30">
> So i leave those undefined.
> concrete : <svg>
> When I run the rasterizer to PNG, this works of course.
> But these PNG's are much too large.
> Result: when included in HTML the layout does not look as hoped for.
> Would it be possible that the rasterizer would automatically generate an
> optimised image size when the attributes width and height are not
> available.

Batik can not now what's the appropriate size as Peter mentions. This is due 
to the use of percentages for example. If a rectangle has a width equals to 
100% - what does it mean ?

You can let your outermost svg element with no width and height. By default 
it means 100%, 100% and it's up to the user agent to choose the size. The 
JSVGCanvas chooses the size of the component (depending on the layout manager 
and the size of your application). The transcoder has 400,400 (which is 
totally arbitrary) but you can set the default size using a transcoding hint.

Hope this helps,

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

View raw message