I have implement Signature-Pad and its working.
so, now I want to store the Signature as .png
image to local/cloudinary
.
$scope.saveCanvas = function() {
var sigImg = signaturePad.toDataURL('image/png');
$scope.signature = sigImg;
console.log("$scope.signature :",$scope.signature);
}
above code gives base64
string like : data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAACWCAYAAABkW7XSAAAY
How can I convert the base64
into .png
image?
I have tried :angular-base64
$scope.decoded = $base64.decode(sigImg);
I don't know how to use this..
thanx..!
You can do it using the following code:
Then you should be able to upload the
blob
to cloudinary.I took this code from the following stackoverflow answer