<div dir="ltr">Simon,<div><br></div><div>I've already got rendering handled so that's not an issue. As an experiment I actually did run through the XML and successfully manipulated the colors of each object... but that's hardly a robust programatically "good" approach if I want to do anything less trivial than change some colors. I'd also like to do this just using some base SVG handling libraries as installing Inkscape will not be an option with some of my deploy targets.</div>
<div><br></div><div>It seems you are saying Cairo can open an SVG as a surface, then draw on top of it, but has absolutely no functionality to re-instantiate the objects in the SVG DOM and make them available. If this is true then how does it handle rendering of the vector objects of the SVG at all? I'm quite confused here!</div>
<div><br></div><div>Thanks,</div><div>-Rei</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014/1/4 Simon Sapin <span dir="ltr"><<a href="mailto:simon.sapin@exyr.org" target="_blank">simon.sapin@exyr.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 03/01/2014 19:02, 影月 零 wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is it possible to edit the content of an SVG image and then save the<br>
result back? I don't mean just drawing on top of the image, I mean<br>
manipulating objects/vectors within the image. I've been searching but<br>
haven't found a good sample or explanation of how this would be done, if<br>
it is possible.<br>
</blockquote>
<br></div></div>
Hi,<br>
<br>
cairo itself does not read or otherwise render SVG files. (There are SVG renderers based on cairo, though.)<br>
<br>
You could use an XML parser and manipulate XML elements.<br>
<br>
Or look into making an Inkscape extension:<br>
<a href="http://wiki.inkscape.org/wiki/index.php/ScriptingHOWTO" target="_blank">http://wiki.inkscape.org/wiki/<u></u>index.php/ScriptingHOWTO</a><span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Simon Sapin</font></span><div class="HOEnZb"><div class="h5"><br>
-- <br>
cairo mailing list<br>
<a href="mailto:cairo@cairographics.org" target="_blank">cairo@cairographics.org</a><br>
<a href="http://lists.cairographics.org/mailman/listinfo/cairo" target="_blank">http://lists.cairographics.<u></u>org/mailman/listinfo/cairo</a></div></div></blockquote></div><br></div>