Table 使用 wkhtmltopdf 节点模块转换为 pdf 时行被截断

Table row is getting cut while using wkhtmltopdf node module converting to pdf

在将 HTML 转换为 PDF 时遇到问题,长约 3-4 页的表格数据可用。它被切割和扭曲。

我尝试了大部分与 wkhtmltopdf Whosebug 线程相关的解决方案。

table, tr, td, th, tbody, thead, tfoot {
    page-break-inside: avoid !important;
}

这对我没有帮助

这方面有什么帮助吗?

将 wkhtmltopdf 升级到版本 0.12.5 并修补了 qt 解决了我的问题。

Script to install wkhtmltopdf 0.12.5 with qt patched on ubuntu

如果您遇到与缩放和额外空白相关的任何问题,请尝试在 wkhtmltopdf npm package

--zoom  value between 0.0 to 1.0

--disable-smart-shrinking 

来自 github 的相关问题: Regression on upgrade from 0.12.3 to 0.12.5