Answer the question
In order to leave comments, you need to log in
Saving paper.js result
Hello.
Please, tell me how you can save the canvas with figures drawn in paper.js, so that you can then draw them using the same library.
I mean the way to get the data in the canvas, and how to put it back there.
Please, if you have any leading questions, I will be happy to answer.
Thank you!
Answer the question
In order to leave comments, you need to log in
I did not find canvas data serialization methods in the library. Existing solutions are self-written, and are often suitable for specific tasks. But a solution was found, albeit not so elegant.
I save canvas data in js as an image. I send it to the server, and then I give it to the client.
var canvas = document.getElementById("mycanvas");
var img = canvas.toDataURL("image/png");
document.write('<img src="'+img+'"/>');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question