[英]Nodejs | npm : html-pdf,set image size
I'm using html-pdf to convert an SVG file to PNG, and I can't get the output image size to reflect the input size (128x128).我正在使用 html-pdf 将 SVG 文件转换为 PNG,但我无法获得输出图像大小来反映输入大小 (128x128)。 Instead it comes with blank space (see image below).相反,它带有空格(见下图)。 I've tried explicitly setting width and height, setting header and footer height (as per this link<\/a> ), but nothing has any effect.我已经尝试明确设置宽度和高度,设置页眉和页脚高度(根据此链接<\/a>),但没有任何效果。
htmlpdf.create(qrcode, { "border": "0", "type": "png"}).toFile(originalname.split(".")[0]+".png", function(err, res) {
if (err) throw err;
console.log(res);
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.