-
Notifications
You must be signed in to change notification settings - Fork 539
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
getText() -> Maximum function nesting level of '100' reached, aborting! #20
Comments
related to #28 |
I already thought both issues were related. The problem is not an infinite loop though, it's not infinite. But still nested too deep. |
Right. I had fixed this issue by increasing the memory for the script. So there are 2 options if I understand it: either PdfParser goes as deep as possible and extracts all texts or we go not so deep and can not extract all texts. The Page object contains everything and this object is parsed in each run of the loop. My PHP installation gave me a warning about using too much memory (allowed memory size of ... exhausted ...) which was partly solved by increasing/setting a higher memory limit for the script. Is this the right line? https://github.com/smalot/pdfparser/blob/master/src/Smalot/PdfParser/Object.php#L136 I would say it is not a bug but a problem with special PDF versions and the nesting of contents and especially with XDebug (it seems you are using xdebug and this is a known problem/bug in XDebug). Also, please take a look at: and http://stackoverflow.com/questions/4293775/increasing-nesting-functions-calls-limit and http://stackoverflow.com/questions/10157649/maximum-function-nesting-level-of-100-reached-aborting I do not get your error but just warns about the memory limit. I do not use XDebug. |
@smalot I think we should flatten the whole structure a bit, so we have less recursive function calls. One solution would be an array: http://stackoverflow.com/a/8656421/753676 Another solution is SplQueue (maybe much faster and better but needs at least PHP 5.3) http://www.php.net/manual/en/class.splqueue.php |
Currently PHP 5.3 is already a requirement due to namespace use. Envoyé avec AquaMail pour Android Le 22 mars 2014 15:34:52 Daniel Ruf notifications@github.com a écrit :
|
Right, but we need to change the structure and use a queue. |
I'm having small document (4 pages) and still getting this issue due an infinite recursion where text of an object with PDF: https://www.dropbox.com/s/ks78qbatmik1d2k/nesting_level_issue.pdf?dl=0 Issues happens with top text on last page. |
The mentioned recursion was introduced in 51f7951 commit where support for nested xObjects were introduced. |
Hi Alexander, Currently I'm quite busy, so if you find a fix, I'm ok to test it and Thanks Sébastien MALOT Please consider the environment before printing this email. 2015-01-15 15:33 GMT+01:00 Alexander Obuhovich notifications@github.com:
|
I've created a fix in #55 . Everybody interested please test on your PDFs if that does solve nesting level problem (for users with xdebug installed) / out of memory problem (for users without xdebug installed). |
Add ability for PdfParser to parse metadata names with hexadecimal encoded characters such as "Document#20Type" where \smalot#20 is a space. Resolves Issue smalot#529
* Update Element.php Add ability for PdfParser to parse metadata names with hexadecimal encoded characters such as "Document#20Type" where \#20 is a space. Resolves Issue #529 * Update ElementTest.php Add test for spaces in metadata property names. * Make sure we fully support hex Too quick on the commit! Make sure our two 'digit' regexp also finds A-F hex digits. Add a test for #2d which is a hyphen. * fixed coding style issue in Element.php --------- Co-authored-by: Konrad Abicht <hi@inspirito.de>
Hi,
Today I received feedback about a failing PDF. It generated a function nesting error.
I wrote a small patch that masked the problem, which is kinda dirty.
I can only upload images to a ticket, so I uploaded the files somewhere else:
The error call stack: http://nederland.ligtin.eu/sthoolen/20140217-pdfparser-error.html
The dirty patch: http://nederland.ligtin.eu/sthoolen/20140217-pdfparser-quickfix.patch
The PDF: http://www.vgogh.nl/documenten/huwelijkse_voorwaarden/files/assets/downloads/publication.pdf
Hopefully this problem can be dealt with in a somewhat more decent way? ;-)
The text was updated successfully, but these errors were encountered: