-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mpdf export can exceed pcre.backtrack_limit #637
Comments
Any update on this? |
Not the answer you are hoping for, but I believe this is limitation of mpdf, not PhpSpreadsheet. I would suggest you comment on mpdf/mpdf#287 and explain your use-case. However if one of you were to submit a PR to fix this in PhpSpreadsheet, I would merge it. Meanwhile I'll close the issue as it is not likely the core team would do anything about it in the foreseeable future. |
Righteo, we will attempt a workaround PR. |
… string Due to a limitation in Mpdf, the HTML string passed to its WriteHTML method must not exceed a particular length. PhpSpreadsheet produces one HTML string containing all spreadsheet data when writing to HTML, which can easily exceed Mpdf's size limit. Thus, it was impossible to write large spreadsheets to PDF using the Mpdf writer - this change fixes that issue. Fixes #637 Fixes #706
… string Due to a limitation in Mpdf, the HTML string passed to its WriteHTML method must not exceed a particular length. PhpSpreadsheet produces one HTML string containing all spreadsheet data when writing to HTML, which can easily exceed Mpdf's size limit. Thus, it was impossible to write large spreadsheets to PDF using the Mpdf writer - this change fixes that issue. Fixes PHPOffice#637 Fixes PHPOffice#706
This is:
What is the expected behavior?
It should be possible to write large spreadsheets from PhpSpreadsheet to PDF, using the Mpdf writer. In order to achieve this, PhpSpreadsheet should pass HTML into Mpdf in reasonably-sized chunks using multiple calls to
WriteHTML
.What is the current behavior?
After the Mpdf writer converts a spreadsheet to HTML, it passes the entirety of the spreadsheet as one big HTML string into Mpdf's
WriteHTML
method. The string size can easily exceed the PHP settingpcre.backtrack_limit
if a larger spreadsheet is being rendered, causing Mpdf to throw an exception and refuse to write the PDF.What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
Which versions of PhpSpreadsheet and PHP are affected?
I'm working with PHP 7.1.20 and PhpSpreadsheet 1.3.1, but I believe this issue still affects newer versions - the Mpdf writer in PhpSpreadsheet 1.4.0 still passes all the HTML as a single string, so the behaviour is unlikely to have changed.
The text was updated successfully, but these errors were encountered: