gpt4 book ai didi

html - 使用 wkhtmltopdf Node 模块转换为 pdf 时表格行被切断

转载 作者:行者123 更新时间:2023-11-28 10:59:09 24 4
gpt4 key购买 nike

在将 HTML 转换为 PDF 时面临的问题很长,几乎有 3-4 页的表格数据可用。它被切割和扭曲。

我尝试了大多数与 wkhtmltopdf stackoverflow 线程相关的解决方案。 enter image description here

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

关于html - 使用 wkhtmltopdf Node 模块转换为 pdf 时表格行被切断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58230151/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com