Closed karelbilek closed 3 years ago
oh, I see that this repo is from 2013. :) but it still works for me!
I needed the script for something slightly different (resizing the canvas to square and centering the SVG vertically)
I updated the script to python3 & packaged it to docker, I will send a link there once it's on dockerhub
This tool does edit the XML. That's what the rsvg and Inkscape calls do. I don't think you can simply edit the viewport. You need to scan all elements, find their min/max points to calculate the true bounding box, and then update the viewport. For that you need something that can parse SVG's XML and read those points.
@vmario89 Cool, that looks like just the tool I was looking for back when I did this script. What would be the exact way of invoking vpype
to do what svgclip does? As people seem to find their way here, I'd love to update the README with links to perhaps more relevant and updated software.
Why do you use rsvg/cairo here, when you can just edit the vieport in XML?
It does not reduce the filesize, but is much simpler :)