xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: How to rasterize a SVG but not preserving the aspect ratio?
Date Sat, 14 Jan 2006 12:54:38 GMT
Hi Manuel,

Manuel Mall <manuel@apache.org> wrote on 01/13/2006 11:04:59 PM:

> I need to rasterize SVGs but need in some cases apply non-uniform 
> scaling. The transformers I have seen and sample code I came across 
> always uses uniform scaling, i.e. preserve the aspect ratio.

   No the transformers respect the 'preserveAspectRatio' attribute
on the root SVG element.  The default for this is "xMidYMid meet"
if this is set to "none" then the Transcoders should stretched
non-uniformly.

> The context is that I am currently writing a new renderer for FOP for an 

> output format that doesn't support SVG. Therefore I need to convert the 
> SVG into a raster format and for SVGs included as external-graphics I 
> need to be able to 'obey' the possibly non-uniform scaling specified on 
> the external-graphics element in the XSL-FO document.

   This is an interesting case of 'who should win'.

> Is there an easy way to do this?

   The simplest thing is to adjust the preserveAspectRatio
attribute on the root of the SVG tree before passing it to
the transcoder.

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


Mime
View raw message