Is it possible to insert a blob created from a canvas directly into a cell, instead of just onto the sheet?

Viewed 366

I have created a function for allowing users to "draw" their E-Signature using canvas in an html pop-up, and am able to pass the blob to the google script and insert it onto the sheet, but I would prefer if I could insert it directly into a cell instead of on top of it. Is this possible, or will I need to have them manually select "Put image in selected cell"?

javascript code for converting the canvas to a blob:

function save() {

        var dataURL = canvas.toDataURL('image/png');

        google.script.run.insertSig(dataURL);
        google.script.host.close();
    }

google script for inserting the blob into the spreadsheet:

function insertSig(blb) {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheets()[0];
  sheet.insertImage(blb, 2,2);

}

So this all "works" in the sense that the image is being inserted, but as I said above, I am wondering if it is possible to have this image be placed directly in a specific cell instead of on top of it.

0 Answers
Related