I am developing code to generate PDF from HTML code using library MPDF. For HTML Code I am reading from external HTML file. But its not working for larger HTML code size. Is there any way to fix it or do we have any other library which supports my functionality.
For larger html file giving error:
Fatal error: Uncaught Mpdf\MpdfException: The HTML code size is larger than pcre.backtrack_limit 1000000. You should use WriteHTML() with smaller string lengths.
The error message tells you what to do. Pass your HTML to WriteHTML()
method in smaller chunks.
Or you can try to increase your backtrack limit even more:
ini_set("pcre.backtrack_limit", "5000000");
https://mpdf.github.io/troubleshooting/known-issues.html#blank-pages-or-some-sections-missing