首页 > 解决方案 > node html-pdf 打印出额外的空白页

问题描述

我对节点真的很陌生,对于这个项目,我使用的HTML-pdfAPI 会自动从文件夹中打印出最近的 pdf 文件。我面临的问题是它总是会打印一个额外的空白页。有没有办法使用 HTML-pdf 设置打印唯一的第一页?我只是想消除额外的空白页问题。

代码

  let options = {
    "height": "8.51in",
    "width": "11.25in",
  };
 
  pdf.create(data, options).toFile("report.pdf", function (err, data) {
  console.log('Creating pdf file.');
  if (err) {
   console.log('Error while creating pdf.');
  } else {
  res.send("File created successfully and session id was "+session_id);
  }

标签: javascripthtmlprintinghtml-pdfnode-html-pdf

解决方案


推荐阅读