I am trying to load an SVG file and want to display it on the canvas using KineticJS (KJS), so you need to know if it is possible to show any SVG file with random shapes and paths in it, in the canvas using KJS?
Now SVGs exported through other software are also very different, say, for example, SVG exported via Adobe Illustrator has a fill, stroke, stroke width, etc. As attributes for their respective tags, while SVG exported via Inkscape, all of these are Fill, Stroke, Stroke Width, etc. As the string value of the "style" attribute, their respective tags correspond.
So, I am on the verge of my own SVG parser specific to the SVG format exported by AI, and then use it to redraw the SVG on the canvas via KJS. But before doing this, I just wanted to check:
- Is there any tool available there that can convert all primitive (straight, straight, round, etc.) tags as a path tag? That is, instead of the rect tag and the ellipse, they are converted to equivalent path tags.
- Is there an alternative way to load SVG onto a canvas other than KJS?
source share