Newer
Older
Import / applications / MakePDF / templates / convert.py
@John John on 29 Dec 2020 580 bytes bulk import from macbookpro checkouts
#!/usr/bin/python
from xml.dom import minidom
# import xml.dom.minidom
# import re


svgDoc = minidom.parse('vertical.svg')
itemlist = svgDoc.getElementsByTagName('g')
print(len(itemlist))
for s in itemlist:
    items = s.getElementsByTagName('*') # path')
    for item in items:
        if (item.tagName == 'path'):
            print(item.attributes['d'].value)
# M,m,L,l,H,h,V,v,Z/z
# MoveAbs,MoveRel,LineAbs,LineRel,HorzAbs,HorzRel,VertAbs,VertRel,Close


        elif (item.tagName == 'rect'):
            print(item.attributes['x'].value + "," + item.attributes['y'].value)