On Fri, 4 Apr 2014 15:22:37 +0200 John Smith <lbalbalba@...155...> wrote:
Hi,
Im trying to create svg files in an automated manner (with unix shell scripts, command line tools, etc.) All output must be in SVG so that I can open the resulting files later in MS Visio and/or LibreOffice.
I figured that one way to achieve this could be : layer existing svg files on top of each other. For example, I might have a (relatively) large svg file that draws a piece of grass or a lawn or something. I then have a (relatively) small svg file that draws a tree. I then draw the tree svg on top of the lawn svg a at a few different places at coordinates x,y. The end result would then be an SVG file of a lawn with some tree's in it.
I was wondering if, and if so how, I could achieve this with Inkscape ? So far Ive only managed to convert a single svg image to another svg image like this :
inkscape ./foo.svg --export-plain-svg=./bar.svg
Is there a way to place small svg files on top of another large svg file, at specified locations in the large svg file, from the commandline, with Inkscape?
Hi John,
I have no idea why you would want to do this at all, and I can't tell you a way to do it *with Inkscape*, but it would be fairly easy to set up an AWK or Python program to go through a bunch of one layer source SVGs, and plunk those layers down on a destination SVG. SVG, after all, is just XML.
If you want to do it the right way, the cool way, the way that gets applause from everyone, use Python with lxml.etree, and do it as an actual XML parsing project. Otherwise, just use break logic to find the starting and ending <layer> and do the whole thing as text.
You could either make a program that takes a layer from one source and appends it to the destination layers, or you could put a loop in that program so it does them all.
I bet if you tell us *why* you want to build an SVG from baby SVGs from the command line, somebody will come up with a much better way of doing it.
SteveT
Steve Litt * http://www.troubleshooters.com/ Troubleshooting Training * Human Performance