javascript - node html-pdf 打印出额外的空白页
问题描述
我对节点真的很陌生,对于这个项目,我使用的HTML-pdf
API 会自动从文件夹中打印出最近的 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);
}
解决方案
推荐阅读
- google-app-maker - 教育客户无法使用 Google 应用程序制造商?
- sql - 未创建 SQL 表
- java - 遍历 ArrayList 以查找缺失值并创建一个虚拟对象
- tensorflow - 每 100 步 tensorflow 打印训练精度
- javascript - 服务工作者 skipWaiting 和 clients.claim 在首次加载时未控制浏览器
- php - WordPress 菜单:单击父菜单项时,仅显示该链接的子导航子项
- docker - 在 Docker 容器中创建目标的规则是什么?
- javascript - 我可以在我的 React 应用程序中使用 window.localStorage 吗?
- python-3.x - 在 Python 3.6.5 中使用拆分的 ValueError
- java - 将格式化的字符串转换为日期