Skip to main content

could not create pdf invoice

1 year 7 months ago #366813 by Rusty
-- HikaShop version -- : 5.1.5

Hi!

I use the pdf plugin. But both - the invoice and delivery note - shows an error.
I tried PNG and JPG images - same issue. I can show the logo via direct link in the browser so the path should be correct.
Code:
2 Unable to get the size of the image [https://website_domain.de/images/logo/logo-xyz-260.png] Call Stack # Function Location 1 () JROOT/plugins/hikashop/attachinvoice/vendor/spipu/html2pdf/src/Html2Pdf.php:1526 2 Spipu\Html2Pdf\Html2Pdf->_drawImage() JROOT/plugins/hikashop/attachinvoice/vendor/spipu/html2pdf/src/Html2Pdf.php:5782 3 Spipu\Html2Pdf\Html2Pdf->_tag_open_IMG() JROOT/plugins/hikashop/attachinvoice/vendor/spipu/html2pdf/src/Html2Pdf.php:1444 4 Spipu\Html2Pdf\Html2Pdf->_executeAction() JROOT/plugins/hikashop/attachinvoice/vendor/spipu/html2pdf/src/Html2Pdf.php:1412 5 Spipu\Html2Pdf\Html2Pdf->_makeHTMLcode() JROOT/plugins/hikashop/attachinvoice/vendor/spipu/html2pdf/src/Html2Pdf.php:3136 6 Spipu\Html2Pdf\Html2Pdf->_tag_open_DIV() JROOT/plugins/hikashop/attachinvoice/vendor/spipu/html2pdf/src/Html2Pdf.php:1444 7 Spipu\Html2Pdf\Html2Pdf->_executeAction() JROOT/plugins/hikashop/attachinvoice/vendor/spipu/html2pdf/src/Html2Pdf.php:1412 8 Spipu\Html2Pdf\Html2Pdf->_makeHTMLcode() JROOT/plugins/hikashop/attachinvoice/vendor/spipu/html2pdf/src/Html2Pdf.php:5602 9 Spipu\Html2Pdf\Html2Pdf->_tag_open_TD() JROOT/plugins/hikashop/attachinvoice/vendor/spipu/html2pdf/src/Html2Pdf.php:1444 10 Spipu\Html2Pdf\Html2Pdf->_executeAction() JROOT/plugins/hikashop/attachinvoice/vendor/spipu/html2pdf/src/Html2Pdf.php:1398 11 Spipu\Html2Pdf\Html2Pdf->_makeHTMLcode() JROOT/plugins/hikashop/attachinvoice/vendor/spipu/html2pdf/src/Html2Pdf.php:600 12 Spipu\Html2Pdf\Html2Pdf->writeHTML() JROOT/plugins/hikashop/attachinvoice/attachinvoice.php:1104 13 plgHikashopAttachinvoice->_Html2Pdf() JROOT/plugins/hikashop/attachinvoice/attachinvoice.php:106 14 plgHikashopAttachinvoice->_getPDFInvoice() JROOT/plugins/hikashop/attachinvoice/attachinvoice.php:237 15 plgHikashopAttachinvoice->onHikashopBeforeDisplayView() JROOT/libraries/src/Plugin/CMSPlugin.php:311 16 Joomla\CMS\Plugin\CMSPlugin->{closure:Joomla\CMS\Plugin\CMSPlugin::registerLegacyListener():295}() JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:454 17 Joomla\Event\Dispatcher->dispatch() JROOT/libraries/src/Application/EventAware.php:111 18 Joomla\CMS\Application\WebApplication->triggerEvent() JROOT/administrator/components/com_hikashop/helpers/helper.php:2849 19 hikashopView->display() JROOT/administrator/components/com_hikashop/views/order/view.html.php:30 20 OrderViewOrder->display() JROOT/libraries/src/MVC/Controller/BaseController.php:697 21 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:2601 22 hikashopController->display() JROOT/administrator/components/com_hikashop/controllers/order.php:305 23 OrderController->invoice() JROOT/libraries/src/MVC/Controller/BaseController.php:730 24 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_hikashop/helpers/helper.php:2579 25 hikashopController->execute() JROOT/administrator/components/com_hikashop/hikashop.php:73 26 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71 27 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::{closure:Joomla\CMS\Dispatcher\LegacyComponentDispatcher::dispatch():70}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73 28 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361 29 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:150 30 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:205 31 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:304 32 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:58 33 require_once() JROOT/administrator/index.php:32

Please Log in or Create an account to join the conversation.

1 year 7 months ago #366814 by nicolas
Hi,

This indicates that the PHP running on your server does not have permission to access the logo image in order to include it in the PDF.

The first thing to do is to temporarily change the logo to one hosted on another server that you know does not have protection measures against this.

For example, try using this image ( www.google.fr/images/branding/googlelogo...t_color_272x92dp.png ), which is Google's logo.

If it works with the Google logo but not with your own, it's likely that your site’s `.htaccess` file (or another system like ProxyShield: forums.phpfreaks.com/topic/162357-solved...-that-a-browser-can/ ) has restrictions on the "user-agent", preventing the plugin’s PHP code from accessing your logo.

However, if you encounter the same issue even with the Google logo, then it's more likely related to your PHP configuration, which is blocking external connections (particularly due to the `allow_url_fopen` flag in `php.ini`):
ask.gibbonedu.org/t/allow-url-fopen-1-wont-work/2981/15

Please Log in or Create an account to join the conversation.

1 year 7 months ago #366824 by Rusty
Replied by Rusty on topic could not create pdf invoice
Hi,

nicolas wrote: The first thing to do is to temporarily change the logo to one hosted on another server that you know does not have protection measures against this.

For example, try using this image ( www.google.fr/images/branding/googlelogo...t_color_272x92dp.png ), which is Google's logo.

If it works with the Google logo but not with your own, it's likely that your site’s `.htaccess` file (or another system like ProxyShield: forums.phpfreaks.com/topic/162357-solved...-that-a-browser-can/ ) has restrictions on the "user-agent", preventing the plugin’s PHP code from accessing your logo.


the external Google logo is showing correctly.
But the htaccess tip I did not understand. I use no proxy. It is Joomla's default htaccess.

Please Log in or Create an account to join the conversation.

1 year 7 months ago #366825 by Rusty
Replied by Rusty on topic could not create pdf invoice
I found the solution: I had a directory protection at server level (access restriction for dev area). When I remove it, the logo is displayed. So, I know what to do. Thanks! ;)
The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.047 seconds
Powered by Kunena Forum