-
Notifications
You must be signed in to change notification settings - Fork 537
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
Exception not handling on "Allowed memory size exhausted" #519
Comments
What PHP version are you using? Which version of PDFParser are you using? |
I'm running PHP 8.0.12 and using PDFParser 2.1.0 :-) |
I ran into a similar problem which might have the same cause. Debugging the code I found that the
Which led to the TypeError for It's possible to add a check so that if the result of But I'm unsure what effect doing that will have on the parsing of the PDF. However I was able to catch the error using |
This is probably resolved by #623. The sample PDF is still accessible, and it's working in my copy. |
@bastienuh please try again and get back to us. Thanks |
Probably solved. If not, comment here. |
@k00ni I think it's still an issue. I ran the command with 3GB memory
I am being thrown this: I am on Fatal error: Allowed memory size of 3221225472 bytes exhausted (tried to allocate 1342177280 bytes) in ../vendor/smalot/pdfparser/src/Smalot/PdfParser/Font.php on line 150 Symfony\Component\ErrorHandler\Error\FatalError Allowed memory size of 3221225472 bytes exhausted (tried to allocate 1342177280 bytes) at vendor/smalot/pdfparser/src/Smalot/PdfParser/Font.php:150 Whoops\Exception\ErrorException Allowed memory size of 3221225472 bytes exhausted (tried to allocate 1342177280 bytes) at vendor/smalot/pdfparser/src/Smalot/PdfParser/Font.php:150
2 [internal]:0 I opened this issue -- with more details. |
Hi,
I have the following exception :
I tried to handle it by a try / catch, but it's not working:
The error is in
parseFile()
because the "A" is echoing, but not the "B".Do you know why the exception is not handling?
Maybe it can be a solution to add a try / catch around the
self::uchr
?Thanks for your help and advice :-)
(If it could help, the parsed PDF is here : https://www.assemblee-nationale.fr/dyn/opendata/PIONANR5L15TAP0528.pdf)
The text was updated successfully, but these errors were encountered: