If a pdf has such an object like the followings, tcpdf_parser fails to continue parsing the data.
2 0 obj
<< /Type /Page % 1
/Parent 1 0 R
/MediaBox [ 0 0 839.314286 1186.971429 ]
/Contents 4 0 R
/Group <<
/Type /Group
/S /Transparency
/I true
/CS /DeviceRGB
>>
/Resources 3 0 R
>>
getRawObject() is expected to return an array which contains an object and its offset, but it currently returns an object without its offset if the pdf has % comments. It causes Illegal string offset warnings.
I've created a compact example. Would you please check it?
tcpdi_parser_issue.tar.gz
$ ls
sample.php source.pdf tcpdi_parser
$ php sample.php
PHP Warning: Illegal string offset 'Parffo' in /Users/lancelot/Sandbox/PHP/tcpdi_parser_issue/tcpdi_parser/tcpdi_parser.php on line 712
PHP Warning: Illegal string offset 'Parffp' in /Users/lancelot/Sandbox/PHP/tcpdi_parser_issue/tcpdi_parser/tcpdi_parser.php on line 712
PHP Warning: Illegal string offset 'Parffq' in /Users/lancelot/Sandbox/PHP/tcpdi_parser_issue/tcpdi_parser/tcpdi_parser.php on line 712
...
Additionally, I've created a PR. I'll be grateful if you'd review it.
#23
If a pdf has such an object like the followings,
tcpdf_parserfails to continue parsing the data.getRawObject()is expected to return an array which contains an object and its offset, but it currently returns an object without its offset if the pdf has%comments. It causes Illegal string offset warnings.tcpdi_parser/tcpdi_parser.php
Line 725 in c7c3e86
I've created a compact example. Would you please check it?
tcpdi_parser_issue.tar.gz
Additionally, I've created a PR. I'll be grateful if you'd review it.
#23