[英]Nodejs | npm : html-pdf,set height of the pdf page
我的密码
var options = {format:'A3',border:{top:'30px',bottom:'30px',left:'10px'}}
pdf.create(html,options).toBuffer(function(err, buffer){
res.type('application/pdf');
res.end(buffer, 'binary');
});
这总是以恒定的高度呈现页面。 如何设置页面高度? 谢谢 !
您必须在选项中给页眉和页脚“高度”。 这将类似于:
var options = {format:'A3',header: { "height": "5mm"},footer: { "height": "5mm"}, border:{top:'30px',bottom:'30px',left:'10px'}}
pdf.create(html,options).toBuffer(function(err, buffer){
res.type('application/pdf');
res.end(buffer, 'binary');
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.