Codeigniter 生成超过 1000 行的 PDF
我尝试使用 PHPExcel、mPDF、TCPDF 和 HTML2PDF 从 CodeIgniter 生成 PDF 文件,但从 MySQL 获取生成超过 1000 行时出现问题。问题从内存耗尽开始,我的 xampp 服务器也需要重新启动。如果您成功生成了超过 1000 行的 PDF,请与我分享。谢谢你的建议
I have tried generate PDF file from CodeIgniter using PHPExcel, mPDF, TCPDF and HTML2PDF but there was a problem for generating more than 1000 rows fetching from MySQL. The problem start from memory exhausted also my xampp server needed to restart. Please share with me if you have successfully on generating PDF with more than 1000 rows. Thank's for your advise
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
XAMPP 的 php 副本仅使用固定数量的 RAM,这可能与您的可用资源相差甚远。您可能希望根据您的系统增加该值。
或者您希望 PHP 使用的任何其他数量(以 MB 为单位)的可用 RAM。
XAMPP's copy of php only uses a fixed amount of RAM, which might not be anywhere near your available resources. You may want to increase that based on your system.
Or any other number (in MB) of available RAM that you would like to allow PHP to use.
您可以尝试生成一个 html 文件并通过 htmldoc 传递它。但如果您在低内存环境中运行,即使这样也可能不起作用。
You could try to generate an html file and pass it through htmldoc. But if you are running in a low memory environment, even that may not work.
我使用 fpdf 创建 PDF,并且已经超过 1000 行。
根据您上面所说,我建议问题出在您的数据创建阶段。你能将 1000 行输出到 HTML 中吗?
如果没有发布 SQL 等并查看它
I use fpdf for my PDF creation and have hit plenty bigger than 1000 rows.
I'd suggest the issue is in your data creation phase from what you say above. Can you output 1000 rows to HTML?
If not post the SQL etc and look at that instead