I\'m trying to add a signature pad to a Google Sheet using jSignature. I\'ve added a dialog box that records the signature like this:
//Code.gs
function showDial
To the save the image to your Drive you can do something like this
Your Html Code:
Please draw your signature on the signature pad below:
Server side code:
function showDialog() {
var html = HtmlService.createHtmlOutputFromFile('Sign')
.setWidth(400)
.setHeight(300);
SpreadsheetApp.getUi()
.showModalDialog(html, 'Your Signature is Required');
}
function saveImage(bytes){
var bytes = bytes.split(",")
var blob = Utilities.newBlob(Utilities.base64Decode(bytes[1]), 'image/png');
blob.setName("Sign Pic")
DriveApp.getFolderById("Folder ID to save SignPic").createFile(blob)
}
You will have to keep track of names of image files and insert the pics into the spreadsheet accordingly.