qr-with-logo is a Node package developed to allow for the creation of QR codes with embedded logo images.
Use node package manager (npm) to install install QRLogo.
npm install --save qr-with-logo
const QRLogo = require("qr-with-logo");
const data = JSON.stringify({
name: "Zacharie Happel",
job: "Student/Intern",
grade: "Senior",
});
await QRLogo.generateQRWithLogo(
data,
"test/qrlogo.png",
{},
"PNG",
"qrwithlogo.png"
);
const QRLogo = require("qr-with-logo");
const data = JSON.stringify({
name: "Zacharie Happel",
job: "Student/Intern",
grade: "Senior",
});
const base64 = await QRLogo.generateQRWithLogo(
data,
"test/qrlogo.png",
{},
"base64"
);
QRLogo currently only supports saving images as PNG and the exportation of base64 formatted data.
qrcode to facilitate the creation of the QR codes, and the sharp npm package as the means to which images are overlaid.
qrcode options may be included when creating the QR code image:
const opts = {
errorCorrectionLevel: "H",
rendererOpts: { quality: 0.3 },
};