C.3 Querying
The textual nature of SVG makes it very easy to generate and edit SVG documents with simple scripts. However, no matter what your script is supposed to do, chances are that you will find it necessary to figure out the bounding boxes of some SVG objects (for example, to check if the text inserted into SVG from a database fits the provided space, or to create a background rectangle or frame for a specific object). Proper calculation of a bounding box, in a general case, is way too complex to do in a script—you would have to reimplement a lot of Inkscape’s geometry and rendering code if you want to take into account everything that may affect the bounding box.
Fortunately, instead of all that you can simply ask Inkscape. For example: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access