【发布时间】:2022-02-10 22:24:16
【问题描述】:
我正在使用 html-pdf 将 SVG 文件转换为 PNG,但我无法获得输出图像大小来反映输入大小 (128x128)。相反,它带有空格(见下图)。 我试过明确设置宽度和高度,设置页眉和页脚高度(根据this link),但没有任何效果。
有什么建议吗?
代码:
htmlpdf.create(qrcode, { "border": "0", "type": "png"}).toFile(originalname.split(".")[0]+".png", function(err, res) {
if (err) throw err;
console.log(res);
});
【问题讨论】: