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
PDF (invoice or catalog) not showing image(s)
-
- Phoca Member
- Posts: 24
- Joined: 22 Nov 2021, 02:18
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: PDF (invoice or catalog) not showing image(s)
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
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 24
- Joined: 22 Nov 2021, 02:18
Re: PDF (invoice or catalog) not showing image(s)
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...)
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...)
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: PDF (invoice or catalog) not showing image(s)
Do you get some information in PHP error log? Some TCPDF error?
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 24
- Joined: 22 Nov 2021, 02:18
Re: PDF (invoice or catalog) not showing image(s)
on invoice pdf:
no error when trying to pdf export the category catalog
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
...
...
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: PDF (invoice or catalog) not showing image(s)
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
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
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 24
- Joined: 22 Nov 2021, 02:18
Re: PDF (invoice or catalog) not showing image(s)
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
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
-
- Phoca Member
- Posts: 24
- Joined: 22 Nov 2021, 02:18
Re: PDF (invoice or catalog) not showing image(s)
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
to
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?)
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').'" />';
Code: Select all
echo '<img class="ph-catalog-img" src="'. JURI::root(false) . '/' . $image->rel.'" alt="'.PhocacartText::filterValue($v['title'], 'text').'" />';
(my joomla is installed in a 'cms' subfolder not in the root - can this be a problem here for tcpdf?)
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: PDF (invoice or catalog) not showing image(s)
Hi, it looks like the paths changed in J4, I have changed the behaviour for this. Will be set in next version.
Jan
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 24
- Joined: 22 Nov 2021, 02:18
Re: PDF (invoice or catalog) not showing image(s)
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.
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.