1


In my project I am using konvajs. Is there any way to export as a SVG image ?

mkaya387
  • 368
  • 2
  • 10

2 Answers2

1

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.

lavrton
  • 18,973
  • 4
  • 30
  • 63
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.

Max Hudson
  • 9,961
  • 14
  • 57
  • 107