Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import an existing svg with svgwrite - Python

I need to import an existing svg picture and add elements like circle and square on it. My file is 'test.svg' so i tryed
dwg = svgwrite.Drawing('test.svg')
but it create a new svg file without anything. I use the python lib svgwrite, do you have any idea for me?
Thank you, and sorry for my english... I do my best!

like image 825
Chili Avatar asked Nov 24 '16 19:11

Chili


1 Answers

svgwrite will only create svg files. svgwrite does not read svg files. If you want to read, modify and then write the svg, the svgwrite package is not the package to use but I do not know of an appropriate package for you.

It might be possible to create svg which uses a reference to another image. That is there is one svg which you then put a second svg on top of the first. I have not done this and do not know if it would actually work.

like image 165
punchcard Avatar answered Oct 19 '22 22:10

punchcard