[cairo] Editing SVG content with Cairo

影月 零 kagetsuki at gmail.com
Fri Jan 3 19:46:58 PST 2014


I mean open the SVG, then iterate through all the vector objects in it and
alter them somehow; like change the color attribute or make all their lines
into dashed lines.

To be more sepcific, I would like to be able to open an SVG, iterate
through each vector object in it applying some change along the way, then
write out a new SVG.

At the moment I'm using RSVG[2] and Cairo, but I'm assuming it's Cairo that
does all the actual image manipulation. I guess my question could also be
re-phrased as:
Does Cairo or any other library re-instantiate objects from items in the
DOM of an SVG file when it opens them? If so where are they and how can I
iterate over them?

Thanks,
-Rei


2014/1/4 Bryce W. Harrington <b.harrington at samsung.com>

> On Sat, Jan 04, 2014 at 04:02:26AM +0900, 影月 零 wrote:
> > Is it possible to edit the content of an SVG image and then save the
> result
> > back? I don't mean just drawing on top of the image, I mean manipulating
> > objects/vectors within the image. I've been searching but haven't found a
> > good sample or explanation of how this would be done, if it is possible.
>
> Clarify what you mean by 'edit'.  You can certainly edit the XML in an
> editor, or graphically via inkscape, but you probably already know that,
> so I assume you want to do something different?
>
> Bryce
>
> > Thanks,
> > -Rei
>
> > --
> > cairo mailing list
> > cairo at cairographics.org
> > http://lists.cairographics.org/mailman/listinfo/cairo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20140104/0b3e063d/attachment.html>


More information about the cairo mailing list