-
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
can't parse fdpf file from 1.86 version of FPDF and works fine with FPDF 1.81 #703
Comments
@k00ni any news about this issue ? we can't work well parsing PDF's with 2.10 version. its also the same error : [Tue May 28 10:46:34.576806 2024] [proxy_fcgi:error] [pid 3767717] [client 10.1.21.27:53967] AH01071: Got error 'PHP message: PHP Warning: Undefined array key 0 in /var/www/clients/client1/web10/web/application/library/php/pdfparser-2.10.0/src/Smalot/PdfParser/Page.php on line 279; PHP message: PHP Fatal error: Uncaught TypeError: Smalot\PdfParser\Page::getPDFObjectForFpdf(): Return value must be of type Smalot\PdfParser\PDFObject, null returned in /var/www/clients/client1/web10/web/application/library/php/pdfparser-2.10.0/src/Smalot/PdfParser/Page.php:279\nStack trace:\n#0 /var/www/clients/client1/web10/web/application/library/php/pdfparser-2.10.0/src/Smalot/PdfParser/Page.php(399): Smalot\PdfParser\Page->getPDFObjectForFpdf()\n#1 /var/www/clients/client1/web10/web/application/library/php/pdfparser-2.10.0/src/Smalot/PdfParser/Page.php(424): Smalot\PdfParser\Page->extractRawData()\n#2 /var/www/clients/client1/web10/web/application/library/php/pdfparser-2.10.0/src/Smalot/PdfParser/Page.php(504): Smalot\PdfParser\Page->extractDecodedRawData()\n#3 /var/www/clients/client1/web10/web/application/library/php/pdfparser-2.10.0/src/Smalot/PdfParser/Page.php(655): Smalot\PdfParser\Page->getDataCommands()\n#4 /var/www/clients/client1/web10/web/application/library/php/Glenat/App/DocuSignApp....', referer: http://core-test.glenat.com/ |
Please upload a PDF here which causes this problem. |
Here it is. |
I tried your PDF, but PDFParser reported a different error:
Here is my test code (separate branch I may have made a mistake somewhere, can you have a look please? |
here it our code same as yours so didnt know why you have different error! Can you try to save localy the pdf in en tmp file like use maybe solve this problem |
I tried it locally and got the error I mentioned. After #719 got merged, we can run CI for side-branches too and will see if the same error occurs. |
#719 got merged. My last found error is also shown online for your given PDF, for instance here for PHP 7.2: https://github.com/smalot/pdfparser/actions/runs/9386160259/job/25846037622#step:6:37 (or the same error here for PHP 8.3)
Also, which PHP version do you use? Btw. might be the same error as in #714 |
We use PHP 8.2 and before we try in PHP 8.3 i can give you some others PDF if you want generated with other parameters and version : test3_fpdfSeul.pdf |
The error we have in our logs comes from when we parse the data of the pages. We are using a PDF generated by the latest version of FPDF, version 1.86. However, the last version where this error did not occur is 1.81. Therefore, we would like to have, if possible, an idea of what could be causing this error:
Undefined array key 0 in /var/www/clients/client1/web10/web/application/library/php/pdfparser-2.5.0/src/Smalot/PdfParser/Page.php on line 284.
Even with version 2.9.0 of your parser, the error persists. Therefore, I am attaching my PHP parsing code below:
The text was updated successfully, but these errors were encountered: