Page 1 of 2
PDF (invoice or catalog) not showing image(s)
Posted: 30 Nov 2021, 02:02
by jagg1010
Hi,
I installed phoca pdf (beside phoca cart) and now I have the new buttons in category view (to generate the catalog pdf) or the orders view (to generate an invoice pdf).
Problem is these generated pdf files don't have any image in it - so in the invoice the logo is missing (it is shown when using the view invoice icon above the pdf icon, so the logo is there). Also in the generated catalog the product image isn't there.
Any hints?
Thanks
Re: PDF (invoice or catalog) not showing image(s)
Posted: 30 Nov 2021, 02:46
by Jan
Hi, this can be some problem with TCPDF and the server. Which version of Joomla and Phoca PDF do you use? Which image types do you use?
Jan
Re: PDF (invoice or catalog) not showing image(s)
Posted: 30 Nov 2021, 03:01
by jagg1010
PDF v3.0.12 / jpg images for product image / the logo for invoice is a png (with transparency)
I'm still devel. the site (not public for everyone) - so I restricted access with .htpasswd protection.
Could that be a problem? (update: deleted the .htpasswd protection for testing purpose, still no images in generated pdf, so that was not the problem...)
Re: PDF (invoice or catalog) not showing image(s)
Posted: 30 Nov 2021, 03:08
by Jan
Do you get some information in PHP error log? Some TCPDF error?
Re: PDF (invoice or catalog) not showing image(s)
Posted: 30 Nov 2021, 03:20
by jagg1010
on invoice pdf:
Code: Select all
Warning: imagepng(/mnt/web210/d3/50/5466624750/htdocs/cms/administrator/components/com_phocapdf/assets/tcpdf/cache/__tcpdf_9625b674b9a60426d87798f79dc55342_imgmask_alpha_1e0e21d34c47b65a58d82eed56da6fad): failed to open stream: No such file or directory in /mnt/web210/d3/50/5466624750/htdocs/cms/administrator/components/com_phocapdf/assets/tcpdf/tcpdf.php on line 7364 Warning: imagepng(/mnt/web210/d3/50/5466624750/htdocs/cms/administrator/components/com_phocapdf/assets/tcpdf/cache/__tcpdf_9625b674b9a60426d87798f79dc55342_imgmask_plain_1e0e21d34c47b65a58d82eed56da6fad): failed to open stream: No such file or directory in /mnt/web210/d3/50/5466624750/htdocs/cms/administrator/components/com_phocapdf/assets/tcpdf/tcpdf.php on line 7369 %PDF-1.7 %���� 8 0 obj << /Type /Page /Parent 1 0 R /LastModified (D:20211130023312+01'00') /Resources 2 0 R /MediaBox [0.000000 0.000000 595.276000 841.890000] /CropBox [0.000000 0.000000 595.276000 841.890000] /BleedBox [0.000000 0.000000 595.276000 841.890000] /TrimBox [0.000000 0.000000 595.276000 841.890000] /ArtBox [0.000000 0.000000 595.276000 841.890000] /Contents 9 0 R /Rotate 0 /Group << /Type /Group /S /Transparency /CS /DeviceRGB >> /Annots [ 6 0 R 7 0 R ] /PZ 1 >> endobj 9 0 obj <> stre
...
...
no error when trying to pdf export the category catalog
Re: PDF (invoice or catalog) not showing image(s)
Posted: 02 Dec 2021, 18:40
by Jan
Hi, try to see this folder:
administrator/components/com_phocapdf/assets/tcpdf/
and if there will be no subfolder, try to create "cache folder there, so this path will exist:
administrator/components/com_phocapdf/assets/tcpdf/cache
Jan
Re: PDF (invoice or catalog) not showing image(s)
Posted: 02 Dec 2021, 18:56
by jagg1010
ok - with the manually created cache folder the invoice has now my shop logo/image in the pdf
Last remaining problem is now the catalog pdf => category view > I select one category > click on catalog (pdf)
This pdf still has no picture and I get no error at all...
when using the 'catalog (html)' export/button I have the correct image in it
Re: PDF (invoice or catalog) not showing image(s)
Posted: 02 Dec 2021, 19:42
by jagg1010
ok, debugged a little more and found out when I use the complete path/url it works
So changing line 108 \cms\administrator\components\com_phocacart\layouts\catalog.php
from
Code: Select all
echo '<img class="ph-catalog-img" src="'. JURI::root(true) . '/' . $image->rel.'" alt="'.PhocacartText::filterValue($v['title'], 'text').'" />';
to
Code: Select all
echo '<img class="ph-catalog-img" src="'. JURI::root(false) . '/' . $image->rel.'" alt="'.PhocacartText::filterValue($v['title'], 'text').'" />';
I get the image in the catalog (pdf)
(my joomla is installed in a 'cms' subfolder not in the root - can this be a problem here for tcpdf?)
Re: PDF (invoice or catalog) not showing image(s)
Posted: 02 Dec 2021, 20:39
by Jan
Hi, it looks like the paths changed in J4, I have changed the behaviour for this. Will be set in next version.
Jan
Re: PDF (invoice or catalog) not showing image(s)
Posted: 02 Dec 2021, 21:23
by jagg1010
Ok, but my tests above are all with J3 (not J4)
I think I had such a problem already with another (none Joomla) project and tcpdf. Graphics only worked with full path/url. Was there a global tcpdf option for that?! Sorry, a few years back already... don't know it anymore.