html 到 pdf 非常大的文件 php
你好 我正在尝试使用 dompdf-0.5.1 在 php 中创建 pdf 文件 我正在从 html 创建这些文件 我每次尝试创建一个大文件时都会有大量数据,它会卡住,给我错误,有没有我可以使用的库可用于 html 中的大型 pdf 文件 它也适用于小文件和普通文件 谢谢
致命错误:在 E:\AppServ\www\test\include\cellmap.cls.php:237 中未捕获异常“DOMPDF_Internal_Exception”,并带有消息“在 cellmap 中找不到框架”:237 堆栈跟踪:#0 E:\AppServ\www \test\include\table_cell_frame_reflower.cls.php(66): Cellmap->get_frame_position(Object(Table_Cell_Frame_Decorator)) #1 E:\AppServ\www\test\include\frame_decorator.cls.php(387): Table_Cell_Frame_Reflower-> ;reflow() #2 E:\AppServ\www\test\include\table_row_frame_reflower.cls.php(70): Frame_Decorator->reflow() #3 E:\AppServ\www\test\include\frame_decorator.cls. php(387): Table_Row_Frame_Reflower->reflow() #4 E:\AppServ\www\test\include\table_frame_reflower.cls.php(468): Frame_Decorator->reflow() #5 E:\AppServ\www\ test\include\frame_decorator.cls.php(387): Table_Frame_Reflower->reflow() #6 E:\AppServ\www\test\include\block_frame_reflower.cls.php(408): Frame_Decorator->reflow() # 7 E:\AppServ\www\test\include\frame_decorator.cls.php(387): Block_Frame_Reflower->reflow() #8 E:\AppServ\www\test\include\table_cell_frame_reflower.cls.php(115): Frame_Deco 位于 E:\AppServ\www\test\include\cellmap.cls.php 第 237 行
hi
i am trying to create a pdf files in php useing dompdf-0.5.1 i am creating these files from html i have a large number of data everytime i try to create a big file its getting stuck giving me errors is therey any library that i can use for large pdf files from html
also its working for small and normal files
thanks
Fatal error: Uncaught exception 'DOMPDF_Internal_Exception' with message 'Frame not found in cellmap' in E:\AppServ\www\test\include\cellmap.cls.php:237 Stack trace: #0 E:\AppServ\www\test\include\table_cell_frame_reflower.cls.php(66): Cellmap->get_frame_position(Object(Table_Cell_Frame_Decorator)) #1 E:\AppServ\www\test\include\frame_decorator.cls.php(387): Table_Cell_Frame_Reflower->reflow() #2 E:\AppServ\www\test\include\table_row_frame_reflower.cls.php(70): Frame_Decorator->reflow() #3 E:\AppServ\www\test\include\frame_decorator.cls.php(387): Table_Row_Frame_Reflower->reflow() #4 E:\AppServ\www\test\include\table_frame_reflower.cls.php(468): Frame_Decorator->reflow() #5 E:\AppServ\www\test\include\frame_decorator.cls.php(387): Table_Frame_Reflower->reflow() #6 E:\AppServ\www\test\include\block_frame_reflower.cls.php(408): Frame_Decorator->reflow() #7 E:\AppServ\www\test\include\frame_decorator.cls.php(387): Block_Frame_Reflower->reflow() #8 E:\AppServ\www\test\include\table_cell_frame_reflower.cls.php(115): Frame_Deco in E:\AppServ\www\test\include\cellmap.cls.php on line 237
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我建议使用 Webkit to PDF 或 PhantomJS
I would recomend using Webkit to PDF or PhantomJS
刚刚对 DOMpdf 进行了一些研究,并发现了一些与此相关的修复,所以我想分享一下。
我的
dompdf Frame not found in cellmap
错误可以通过编辑includes/cellmap.cls.php
并注释掉每次出现的内容来帮助解决:第 212、231、257、274
行替换with:
这使我能够看到我的多页 PDF 文档实际上在哪里出错。我将其缩小到跨越一页以上的大图像(当然是用户
cms
输入!),因此我将单个图像替换为相同的图像,切成两块,一切都修复了。我还读到,这个错误可以链接到跨越一页以上的 div,但在
0.6.0
beta 3 中发现情况并非如此,因为周围的任何“修复”都没有任何区别,即使虽然我有多个 div 的跨页。修复建议将所有 div 替换为“p”或“span”标签。现在
DOMpdf
正在渲染CMS
生成的页面,没有任何问题,希望这对某人有所帮助,Just had some headbanging going on with
DOMpdf
and found a couple of fixes along the way regarding this, so thought I'd share.My
dompdf Frame not found in cellmap
error could be helped by editingincludes/cellmap.cls.php
and commenting out every occurence of:Lines 212, 231, 257, 274
Substituting with:
This enabled me to see where my mutli-page PDF doc was actually erroring. I narrowed it down to a large image spanning more than one page (user
cms
input of course!) So I swapped the singular image for the same, chopped into 2 pieces and all is fixed.I have also read that this error can be linked to div's spanning more that one page but found in
0.6.0
beta 3 not to be the case, as any 'fix' surrounding that made no difference, even though I have multiple div's spanning pages. The fixes suggesting replacing all div's with either 'p' or 'span' tags.So now
DOMpdf
is rendering outCMS
generated pages with no problems and hope this helps someone along the way,我几天来一直面临着同样的问题,在一个带有 rowspan 和 colspan 的大表中,但没有 border-collapse:collapse (有一个与该属性相关的已知问题)。
我通过将其添加到我的表格元素的样式中解决了这个问题:
希望它有帮助!
I have been facing the same problem for days, in a huge table with rowspan and colspan, but no border-collapse:collapse (there is a known issue related to that property).
I have resolved it by adding this to the style of my table element:
Hope it helps!