You might also keep the preserveAspectRatio attribute in mind if a viewBox is present, although the xMidYMid default is exactly what you describe in your use case...
http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute On Tue, Jul 20, 2010 at 11:19 AM, Joe Pairman <joeyp2...@gmail.com> wrote: > I'm including SVG graphics in PDF user guides. I need to control the > displayed size programmatically, effectively scaling the SVG including > all its content. The best result I've had so far is by changing only > the values of the width and height attributes, leaving everything else > untouched, and not even changing the viewBox. This would seem to fit > with Martin Jacobson's description here: > > http://old.nabble.com/Affine-Transforms-on-JSVGCanvas-Objects-to25206324.html#a25209903 > "The physical (ie display/print) dimensions are given by the "width" > and "height" attributes, while > the drawing dimensions are described by the "viewPort" attribute." > > Is there anything I should beware of when using this approach to > resize/rescale SVG? Anything I'm missing? > > Thanks for any tips. > Joe > > --------------------------------------------------------------------- > To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org > >