CairoSVG
CairoSVG copied to clipboard
Cannot export objects with a specified id
I have a svg document that contains an icon set. For each icon there is a rect with a specific id
that defines the bounding box of the icon to be exported. With inkscape I can export individual icons as follows:
inkscape --export-filename icon101.png --export-id=icon101 all_icons.svg
Is this possible with CairoSVG? I have noticed that I can add a #fragment to the input file/url, and was hoping I could use this to specify the id of the object to export, but that fails:
$ cairosvg -f png -o icon101.png 'all_icons.svg#icon101'
Traceback (most recent call last):
[...]
TypeError: Root node is rect. Should be one of marker, svg, image, or g.
Is this use case supported?
Thanks a lot for the issue, it would be interesting indeed.
@liZe PR #351 implement this feature.
@liZe Ping
Hello!
As you may have noticed, CairoSVG isn’t a full-of-life project and it hasn’t seen much activity for a year…
For a long time, CairoSVG was used by WeasyPrint. To render SVG, PNG or PDF, CairoSVG depends on Cairo, which brought many bugs and limitations in WeasyPrint (and CairoSVG). This led us to remove the Cairo dependency from WeasyPrint, and so to remove the CairoSVG dependency.
Since then, we didn’t do really much on CairoSVG. And, to be honest, we’re not sure about what to do with this project 🤔.
A lot of questions have emerged in our heads. Can it still be a CourtBouillon project, shall we entrust it to someone else? Do people actually expect new features, or only bug fixes? Maybe people don’t expect anything?
And in fact, we can’t answer these questions all by ourselves because we’re not you, we’re not the people using CairoSVG.
So, to know you, your use of CairoSVG and your expectation about the project, we prepared a (short, don’t worry) survey.
Your answers to this survey will help us a lot to come up to a decision about CairoSVG.
The survey is open until the end of April!
The CourtBouillon Team 🍲
Edit: the survey is now closed. Results will be publish soon!
Hello!
The results of the survey have been published! You can discover where CairoSVG is going in our latest blog article 📰.
The CourtBouillon Team 🍲