On Thu, 25 Sep 2008 12:53:49 -0500 Gian Paolo Mureddu <thetargos@...155...> wrote:
I want to batch resize a large number of .svg files _into_ scaled up .svg files, without having to open each individual file, resize and save. Is it possible as command line arguments or through another program like one of ImageMagick?
The automatically changing the file part is easy enough with a variety of tools like python or xsltproc or others, which are all readily available in linux. The part I'm not sure about is the easiest way to apply a scaling effect to a whole SVG file, that's something that requires more knowledge about SVG structure.
http://www.w3.org/TR/SVG11/coords.html
I think the safest route is something like changing the file from this:
<svg> <metadata/> <defs/> sodipodi:namedview/ <blah1/> <blah2/> <blah3/> </svg>
to:
<svg> <metadata/> <defs/> sodipodi:namedview/ <g transform="scale(2.0)"> <blah1/> <blah2/> <blah3/> </g> </svg>
i.e. grouping all the "content" part of the document and applying a scaling factor to it.
The two possible problems (which might not be problems) are (a) telling the difference between content and non-content (preamble / setup elements) and (b) how this would impact Inkscapes layers. I suspect (b) won't matter for your application and (a) could probably be done by just assuming everything except <metadata/>, <defs/>, and sodipodi:namedview/ is content.
If there's an easier way or a fatal flaw in the above maybe someone can chime in?
Cheers -Terry