From an React-App with some graphics created via react-konva / konvajs, I would like to export the graphics to vector-graphic, preferably to pdf- or svg-files.
Is there a way to achieve that without having to rewrite the konva part?
I thought Canvas2PDF might be a way. It provides a canvas2pdf.PdfContext which seems to implement the same interface as the html5 canvas context and outputs pdf.
I just don't see a way to handover its PdfContext to Konva in order to use that instead.
Other pdf libraries, which take an existing context, are able to create raster images only, but not vector graphics.
I think you have to make your own implementation.
You can't pass PdfContext
into Konva
. Even if it has a similar API to the html5 2d context, I guess it is not 100% the same.