Description
Preconditions and environment
- Magento version 2.4.6-p2
- Anything else that would help a developer reproduce the bug
Attached an png image to reproduce
Attached an jpg image to reproduce
Steps to reproduce
-
Configure the "Logo for PDF Print-outs" in Sales->Sales->Invoice and Packing Slip Design with the given PNG.
-
Try to print a PDF invoice
-
You receive the following error:
{"0":"Warning: Trying to access array offset on value of type null in \/vendor\/magento\/zend-pdf\/library\/Zend\/Pdf\/Resource\/Image\/Png.php on line 291","1":"#1 Zend_Pdf_Resource_Image_Png->__construct() called at [vendor\/magento\/zend-pdf\/library\/Zend\/Pdf\/Resource\/ImageFactory.php:54]\n#2 Zend_Pdf_Resource_ImageFactory::factory() called at [vendor\/magento\/zend-pdf\/library\/Zend\/Pdf\/Image.php:124]\n#3 Zend_Pdf_Image::imageWithPath() called at [vendor\/magento\/module-sales\/Model\/Order\/Pdf\/AbstractPdf.php:282]\n#4 Magento\\Sales\\Model\\Order\\Pdf\\AbstractPdf->insertLogo() called at [vendor\/magento\/module-sales\/Model\/Order\/Pdf\/Invoice.php:140]\n#5 Magento\\Sales\\Model\\Order\\Pdf\\Invoice->getPdf() called at [vendor\/magento\/module-sales\/Controller\/Adminhtml\/Invoice\/AbstractInvoice\/PrintAction.php:58]\n#6 Magento\\Sales\\Controller\\Adminhtml\\Invoice\\AbstractInvoice\\PrintAction->execute() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#7 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#8 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#9 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->___callPlugins() called at [generated\/code\/Magento\/Sales\/Controller\/Adminhtml\/Order\/Invoice\/PrintAction\/Interceptor.php:23]\n#10 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->execute() called at [vendor\/magento\/framework\/App\/Action\/Action.php:111]\n#11 Magento\\Framework\\App\\Action\\Action->dispatch() called at [vendor\/magento\/module-backend\/App\/AbstractAction.php:151]\n#12 Magento\\Backend\\App\\AbstractAction->dispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#13 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#14 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/module-backend\/App\/Action\/Plugin\/Authentication.php:145]\n#15 Magento\\Backend\\App\\Action\\Plugin\\Authentication->aroundDispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:135]\n#16 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#17 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->___callPlugins() called at [generated\/code\/Magento\/Sales\/Controller\/Adminhtml\/Order\/Invoice\/PrintAction\/Interceptor.php:32]\n#18 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->dispatch() called at [vendor\/magento\/framework\/App\/FrontController.php:245]\n#19 Magento\\Framework\\App\\FrontController->getActionResponse() called at [vendor\/magento\/framework\/App\/FrontController.php:212]\n#20 Magento\\Framework\\App\\FrontController->processRequest() called at [vendor\/magento\/framework\/App\/FrontController.php:147]\n#21 Magento\\Framework\\App\\FrontController->dispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#22 Magento\\Framework\\App\\FrontController\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#23 Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#24 Magento\\Framework\\App\\FrontController\\Interceptor->___callPlugins() called at [generated\/code\/Magento\/Framework\/App\/FrontController\/Interceptor.php:23]\n#25 Magento\\Framework\\App\\FrontController\\Interceptor->dispatch() called at [vendor\/magento\/framework\/App\/Http.php:116]\n#26 Magento\\Framework\\App\\Http->launch() called at [vendor\/magento\/framework\/App\/Bootstrap.php:264]\n#27 Magento\\Framework\\App\\Bootstrap->run() called at [pub\/index.php:30]\n","url":"\/admin\/sales\/order_invoice\/print\/invoice_id\/13083\/key\/74ba62670c05c57820e0765f8efd774afffaa898a5ea2f97ccdb9bf53da94241\/","script_name":"\/index.php","report_id":"2e0b1428c1bd6c499aed5f0128ab15cf066dc2b14bfded767f92cb6f13da231e"}
-
When you switch the logo to a JPG or another PNG you won't receive that error but no image is printed to the PDF, it's just blank where the logo is supposed to be.
Expected result
It's expected that the logo can still be printed on the PDF invoice.
Actual result
Either an error is thrown or no logo is printed.
Additional information
No response
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.