Calculate bounding box
@liZe Are you able to suggest a method for using cairosvg for determining the bounding box of an svg? I am processing svg's to resize to the content and am currently using cairosvg to convert the svg to png (working well) and using PIL getbbox() to get the bounding box of the png and then using this to determine the viewBox size for the svg. I have noticed that cairosvg calculates the bounding box of paths, etc. so wondered if I could use that directly?
Hello!
You’ll find in the bounding_box module all the functions you need to calculate the bounding box of the SVG. You’ll have to create a Surface and to call the calculate_bounding_box function.
(And we can thank @ErikOnBike who wrote the main part of the module!)