How to resize an SVG document?

Jul 23, 2009 at 11:33 AM

Hi there,

is it possible (and if so, how?) to resize (scale) an SVG document?




Jul 23, 2009 at 11:53 AM


The best way to do this would be to apply a scale transform to the root element:

<svg ... transform="scale(2)" ...>

Or using the API after the document has been loaded:

var svgDoc = SvgDocument.Open("path");
svgDoc.Transforms.Add(new SvgScale(2));

The scale factor can be positive or negative.

If you do this watch out for width and height though, as the system isn't yet automatically adjusting them based on scaling. So if you scale up or down apply the same scaling to the Width & Height properties of the document.


Jul 23, 2009 at 1:08 PM

Hi Scriv,

great, thanks for helping so fast :-)!

Your solution worked perfectly, except one little caveat: You have to insert a

svgDoc.Transforms = new SvgTransformsCollection();

in between.