Saving the image

To save the image on the server you have to get the image data from the painter and send it to ther server.

You can get the image data using the painter method getImageData(options).

    var imageData = painter.getImageData();

This method returns the image as JavaScript string having data URI format:




Then you can send the obtained string to the server using a hidden field in an HTML form or using AJAX.
Your server-side script will have to decode the data and convert it to binary image file (if necessary) or save it on the server as is.