I am trying to load SVG file and want to display it on canvas using KineticJS (KJS), so wanted to know whether it is possible to show any SVG file with random shapes and paths in it, in canvas using KJS?
Now SVGs exported via different software also differ a lot, let say for example the in the SVG exported via Adobe Illustrator has fill, stroke, stroke-width etc. As attributes to their respective tags, while the SVG exported via Inkscape has all of these I.e. Fill, stroke, stroke-width etc. As a string value for the "style" attribute to their respective tags.
So I am at the verge of writing a SVG parser of my own, specific to format of SVG exported by AI and then use it to redraw the SVG on canvas via KJS. But before doing that, I just wanted to check:
- Is there any tool available out there, which could convert all the primitive (line, rect, circle, etc) tags as path tag? I.e. Instead of rect & ellipse tag, they are converted to their equivalent path tags.
- Is there any alternative way of loading SVG onto canvas other than KJS?