On Tue, 28 Sep 2010 00:50:55 +0300 Ogla Sungutay <ogla@...2470...> wrote:
I need to add the size of the SVG_G_ELEMENT in a custom namespace as seen below: <g inkscape:label="baz" id="foo" myNamespace:width="647" myNamespace:height="400"
This will require some hacking, so before I go into the code, I wanted to get some feedback from you; I'm hoping that you can give me some directions or offer me solutions.
note that
inkscape --without-gui --query-all somefile.svg
"Lists id,x,y,w,h for all objects" - and it can be invoked from within other programs via the appropriate system() type call quite effectively, it's much faster than actually running inkscape with the GUI. You get text on stdout like:
g5546,195.75278,264.30257,352.58904,352.58905 path5548,195.75278,264.30258,352.58904,352.58904 g5550,195.75278,264.30257,352.58904,352.58904 path5552,195.75278,264.30257,352.58904,352.58904 path5554,233.61326,302.13289,276.91928,276.91926 text5556,203.3647,277.76946,332.10138,329.30381
so it does include groups (gXXXX is a group).
You can even use it from an inkscape python extension :-)
Might not be relevant, but just pointing it out.
Cheers -Terry