2017-03-03 165 views

回答

1

你可以这样做:

doc.text('This is a footer', 20, doc.page.height - 50, { 
    lineBreak: false 
    }); 
0

这个图书馆,我建议阅读PDF文档,这是一个很多必须完成在线HTML文档。

警告:为了能够在主要内容区域之外进行写入,您必须在文本的函数参数中设置高度和宽度。

,从而看到pdf文档,你可以这样做:

const doc = new PDFDocument({bufferPages: true}) 

//addPage X times 

const range = doc.bufferedPageRange(); 

for(let i = range.start; i < (range.start + range.count); i++) { 

    doc.switchToPage(i); 
    doc.text(`Page ${i + 1} of ${range.count}`, 
      200, 
      doc.page.height - 40, 
      { height : 25, width : 100}); 
} 
相关问题