Library to parse SVG in Ruby or Python [closed]

2019-04-28 17:01发布

SVG is a huge standard, which is based on XML. I have parsed SVG as XML in the past. However, some things are hard.

For example, I would like to know the size of a group. As far as I can tell, this is only possible by recursively stepping through all the children in the group (noting all their transformations) and accumulating their sizes.

I would love to have a library that could do stuff like that for me. Does something like this exist?

标签: python ruby svg
1条回答
\"骚年 ilove
2楼-- · 2019-04-28 17:37

In python you have pysvg:

import pysvg.parser

svg = pysvg.parser.parse(<filename>)
print svg.get_width(), svg.get_height()
查看更多
登录 后发表回答