In my project I am using konvajs. Is there any way to export as a SVG image ?
Is there any way to export as a SVG on Konva
1k Views Asked by mkaya387 At
3
There are 3 best solutions below
0

Konva
doesn't have an API to export a stage into SVG. The only way around is to make your own SVG-to-konva and konva-to-SVG converter.
0

You can generate an svg by using the canvas2svg package and tying it into the underlying canvas reference.
You can set your Layer's context equal to a c2s instance, rendering it, and resetting your Layer's ref to what it was previously, as shown here.
I have found library to do that, which is quite new. I did some tests, and it seems to work well.
This library for Konva React version.
Links
https://www.npmjs.com/package/react-konva-to-svg