I use EasyQRCodeJS, a library to generate Qr Codes.
The Qr code is displayed. However, I want to save the image in base 64 to use it later. The console shows the output in base64 format, but I can't store this value.
var storeBase64 = '';
var optionsQr = {
text: 'Hello',
width: 216,
height: 216,
correctLevel : QRCode.CorrectLevel.H,
onRenderingEnd:function(options, dataURL) {
console.info(dataURL); /* Ok */
storeBase64 = dataURL; /* Nok */
}
}
new QRCode(document.querySelector('#myqr'), optionsQr);
console.log(storeBase64); /* Nok */