dompdf表格渲染问题
我正在使用 DomPDF 在我正在进行的项目中生成发票。 我之前已经这样做过几次,从来没有遇到过任何麻烦,但从今天开始,它变得如此缓慢,以至于达到了最大执行时间。 我已经确认发生这种情况的原因是:$dompdf->render()
我正在生成一些表来显示数据。但似乎发现这个表相当困难。有谁知道可能是什么问题?
dompdf 和我的表格可以找到: http://pastebin.com/G585VQma (我想我会把它放在pastebin上以节省一些空间)
I'm using DomPDF to generate invoices in a project I'm working on.
I've done so several times before and never had any trouble but since today however It got so slow that the maximum execution time gets reached.
I've confirmed that this happens because of: $dompdf->render()
I'm generating some tables to display the data in. but is seems to find this table quite difficult. Does anyone know what could be the problem?
dompdf and my table can be found: http://pastebin.com/G585VQma
(figured I'd put it on pastebin to save some space)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
dompdf 不支持通过页面拆分表格单元格,因此您需要将带有
cellspacing="10"
的表格更改为具有相同样式的块元素,例如div
,或者至少不要把有很多行的表格放在这些表格里面。dompdf doesn't support splitting table cells through pages, so you need to change the tables with
cellspacing="10"
into block elements likediv
s with the same styling, or at least not put the tables with many lines inside of these tables.