how I can generate QR code in react js or node js?
Maybe you know a library or package for generating QR code together with the image in a center?)
Example

how I can generate QR code in react js or node js?
Maybe you know a library or package for generating QR code together with the image in a center?)
Example

This function will create qrcode with a logo at centre.
const qrcode= require('qrcode');
const getQRcodeImage = async () => {
try {
let canvas=await qrcode.toCanvas(`my sample text`);
//adding a log at center
const imgDim={width:30,height:30}; //logo dimention
var context = canvas.getContext('2d');
var imageObj = new Image();
imageObj.src = './images/logo.png';
imageObj.onload = function() {
context.drawImage(imageObj,
canvas.width / 2 - imgDim.width / 2,
canvas.height / 2 - imgDim.height / 2,imgDim.width,imgDim.height);
};
return canvas;
}catch (e) {
console.error(e);
return "";
}
}
Usage:
$(document).ready(function () {
getQRcodeImage().then(res=>{$("#qrcodeAuth").html( res);});
}
I think there are many free API's could generate a QR code with logo inside, ie: http://qrickit.com/qrickit_apps/qrickit_api.php