簡體   English   中英

Nodejs | npm:html-pdf,設置pdf頁面的高度

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM