The HTML code size is larger than pcre.backtrack_limit

Created on 8 January 2025, 16 days ago

I recently ran into an issue with generating a PDF from a larger data set.

"Uncaught Mpdf\MpdfException: The HTML code size is larger than pcre.backtrack_limit 50000. You should use WriteHTML() with smaller string lengths."

Altering the backtrack_limit was not an option, nor was reducing the source data length, so we patched the module to check whether the HTML exceeded the limit and split the HTML into smaller chunks before writing to MPDF.

I've tagged this as a bug as I think it falls under scalability issues, but probably most people will never run into the backtrack_limit. The attached patch may help for anyone else who does encounter this.

🐛 Bug report
Status

Active

Version

2.2

Component

Code

Created by

🇬🇧United Kingdom kewesley

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024