2 years ago
#64459
binura
When i generating and saving images the texts in the images are turns to squares in node js
when i'm generating qr images using easyqrcodejs-nodejs and save it in the azure storage texts in the image turns to squares. why is this happens? i used pdfkit and jspdf as the pdf generator. this also happens when i generating and saving the pdf also
var options = {
text: link,
logo: "https://spadesprodblob.blob.core.windows.net/file-storage/restaurant/1641807876154-lg1.png",
width: 220,
height: 220,
colorDark: "#000000",
colorLight: "#ffffff",
correctLevel: QRCode.CorrectLevel.H, // L, M, Q, H
title:`Table#${title}`,
titleFont: "normal normal bold 20px Arial", //font. default is "bold 16px Arial"
titleColor: "#000", // color. default is "#000"
titleBackgroundColor: "#fff", // background color. default is "#fff"
titleHeight: 30, // height, including subTitle. default is 0
titleTop: 10, // draws y coordinates. default is 30
subTitle: wifi,
subTitleFont: "normal normal normal 14px Arial", // font. default is "14px Arial"
subTitleColor: "#000", // color. default is "4F4F4F"
subTitleTop: 320, // draws y coordinates. default is 0
quietZoneColor: "rgba(255, 255, 255,0)",
quietZone: 75,
backgroundImage: 'https://spadesprodblob.blob.core.windows.net/file-storage/restaurant/1641802309587-background.png', // Background Image
backgroundImageAlpha: 1, // Background image transparency, value between 0 and 1. default is 1.
autoColorDark: "rgba(0, 0, 0, .6)",
binary: true,
};
// New instance with options
var qrcode = new QRCode(options);
const qr_code_url = await RestaurantService.uploadImageByPath(imageTemppath);
console.log(QRRes)
const image_base_url = await qrcode.toDataURL().then(data => {
return data
});
var doc = new jsPDF();
doc.addImage(image_base_url, 'PNG', 2, 20, 200, 200);
node.js
azure-blob-storage
image-generation
0 Answers
Your Answer