This is how I’m doing it for my other project:
var canvas = document.getElementById(canvasId);
var imgData = canvas.toDataURL(‘image/jpeg’, .7);
Then I send imgData to the server.
On the server side , I’m removing “data:image/jpeg;base64” from the received data and then do base 64 decode. Then I just write the data to a file.
I’m not sure if that would work for Shape Spark.
The screenshot function that is available in the Editor is much better, I’m assuming it is done not only with JavaScript.