Home » Javascript » base64 string of the QR code

base64 string of the QR code

Posted by: admin August 19, 2018 Leave a comment

Questions:

I want to get base64 string of QR code. Im using qrcode.js
I quite do not understand qrurl.drawImage(aeqr, 0, 0, 120, 120); this part.

var aeqr;
var qrurl = new QRCode(document.getElementById("qrcode"), {
        width : 140,
        height : 140
    });
var qrdest = "text";
aeqr = document.getElementById("qrjs"); //getting ID from qrcode.js

aeqr.onload = function() {
 qrurl.drawImage(aeqr, 0, 0, 120, 120);
 var qrdataURL = qrcanvas.toDataURL();
}

qrurl.makeCode(qrdest);
Answers: