美文网首页
python2环境下svg转化成png格式

python2环境下svg转化成png格式

作者: 不_一 | 来源:发表于2019-02-15 21:10 被阅读0次
$ pip install svglib

You can use svglib as a Python package e.g. like in the following interactive Python session:

>>> from svglib.svglib import svg2rlg
>>> from reportlab.graphics import renderPDF, renderPM
>>>
>>> drawing = svg2rlg("file.svg")
>>> renderPDF.drawToFile(drawing, "file.pdf")
>>> renderPM.drawToFile(drawing, "file.png", fmt="PNG")

相关文章

网友评论

      本文标题:python2环境下svg转化成png格式

      本文链接:https://www.haomeiwen.com/subject/ehjmeqtx.html