I have an svg file and I want to insert other svg object inside this existent.
import svgwrite
dwg = svgwrite.Drawing('model.svg')
square = dwg.add(dwg.rect(20,20),(80,80), fill='blue'))
dwg.save()
it returns a new file with this shape ignoring my previous file. How could I write this?
Thank's
I found a module to do that
import svgutils.transform as st
template = st.fromfile('template.svg')
second_svg = st.fromfile('second.svg')
template.append(second_svg)
template.save('merged.svg')
I hope that works for you too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With