Skip to content
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

PHP 7.2 error: A non-numeric value encountered (tcpdi_parser.php( line 1052 )) #22

Open
michaelklopf opened this issue May 8, 2018 · 2 comments

Comments

@michaelklopf
Copy link

I've got a special set of pdfs which cause this error in the following line:

$this->objstreamobjs[$ints[$j-1]] = array($key, $ints[$j]+$first);

It should be related to the warning here: http://php.net/manual/en/migration71.other-changes.php

According to XDebug it tries to do the following but fails:

$this->objstreamobjs["x��XmO#G��޿��/�Ec�K�[�EbḠܲ(���"] = [[3, 0], 218];
@michaelklopf
Copy link
Author

Suppressing this error with @ gets me further, but is this a best practice here?

     $this->objstreamobjs[$ints[$j-1]] = @array($key, $ints[$j]+$first);

@supergert
Copy link

I encountered this same issue today (tcpdi_parser.php version 1.1).
It turns out to be inside the function decodeStream().
If the $sdic contains a /Filter with an array of filters ($v[0] = PDF_TYPE_ARRAY), it is skipped because of line 1132:
if ($v[0] == PDF_TYPE_TOKEN) {
Not sure why this line is needed at all in decodeStream().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants