VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: en jie rudd on October 21, 2016, 07:10:25 AM

Title: TCPDF errors related to VM products
Post by: en jie rudd on October 21, 2016, 07:10:25 AM
Hello everyone

I have been have recently run into an issue with TCPDF errors related to VM products. I have searched the forum and most of the discussions are pointing to the shipment images vs TCPDF, but nothing (as far as I could find) to vm products.

I have been getting a long list of 'soft 404' errors from GWMT recently and the list expends by day all end up with 'https://www.example.com/example_VM_product.html?format=pdf&tmpl=component'. When searched the the link source, there is this error report of 'TCPDF ERROR: [Image] Unable to get the size of the image: /images/stories/virtuemart/product/example_VM_product.jpg'. The list appears to be going to cover all my VM products eventually. All my product images are in jpg and they have always been (but not such issue before).

I have recently upgraded to a new template:
template: Gavick Storefront
Joomla: 3.6.3
VM: 3.0.18
tcpdf: 1.0.2

I have search the forums and my developer has tried almost all recommendations out there without luck.

Any help, advice or recommendation will be greatly appreciated.

best regards

En Jie (administrator but NOT programmer)
Title: Re: TCPDF errors related to VM products
Post by: Studio 42 on October 23, 2016, 00:23:03 AM
QuoteTCPDF ERROR: [Image] Unable to get the size of the image: /images/stories/virtuemart/product/example_VM_product.jpg'
dos not mean that TCPDF cannot handel this type of file, but that tcpdf do not find or cannot convert it.
So i think the probel is that image do not use full path.
TCPDF like JPATH_ROOT.'/images/stories/virtuemart/product/example_VM_product.jpg or can handel  https://www.example.com/images/stories/virtuemart/product/example_VM_product.jpg, but fail if is not configured properly with relative paths.
Title: Re: TCPDF errors related to VM products
Post by: en jie rudd on October 23, 2016, 12:34:23 PM
Hello Studio 42

Thank you very much for your time and reply.

As I am not familiar with the TCPDF configuration, any advice on how this could be correctly configured?

Best regards

En Jie
Title: Re: TCPDF errors related to VM products
Post by: GJC Web Design on October 23, 2016, 15:39:28 PM
there is a long post on here somewhere with me, Max and Alatak  about the path for images for TCPDF  .. from memory it was a server thing...
Title: Re: TCPDF errors related to VM products
Post by: jenkinhill on October 23, 2016, 16:24:36 PM
There is no configuration for TCPDF. In default VM TCPDF is used for invoice creation and not in the product page.

You don't give any version history but I wonder if this would help:  http://forum.virtuemart.net/index.php?topic=135774.msg473425#msg473425
Title: Re: TCPDF errors related to VM products
Post by: Studio 42 on October 23, 2016, 17:54:12 PM
VMTCPDF is for orders PDF, TCPDF is the library used by default with the PDF view, so this sould work for any component that can use format=raw.
But the current PDF document default render is not including full paths and this need fixes
(note that this was working with old tcpdf main class)
If you need a way to render any HTML as PDF read : http://studio42.github.io/joomla-pdf-document-view/index.html
And install what you need. This should work for any components adding &format=pdf in the llink.
I don't know if this fix the problem for images, but if you can install wkhtmltopdf, then you have a perfect render(see my test http://studio42.github.io/joomla-pdf-document-view/perf.html)
And to isntall it : http://studio42.github.io/joomla-pdf-document-view/install.html
You can install all class, if you watn compare results, some are big and you have to add the files manually in your Joomla folders.
Title: Re: TCPDF errors related to VM products
Post by: jenkinhill on October 23, 2016, 20:36:33 PM
On a clean J3.6.3, VM3.0.18 and com_tcpdf_1.0.2 with Protostar & default VM templates there is no problem with the pdf rendering of the product page. 

Which would lead to the possibility of a Gavick template issue or the problem that some have had following "upgrade" to J3.6.3 on sites that have been upgraded from very old VM versions, solved by deleting the root/components/com_tcpdf directory.
Title: Re: TCPDF errors related to VM products
Post by: en jie rudd on October 26, 2016, 06:22:08 AM
Hello everyone

Thank you very much for your replies and support.

I have now: deleted the root/components/com_tcpdf directory (although my site was upgraded from VM 2.5 to VM 3.0.

I will monitor the error reports before taking the next step.

I will also keep this post updated.

best regards

En Jie

Title: Re: TCPDF errors related to VM products
Post by: en jie rudd on December 12, 2016, 21:34:45 PM
Hello all helpers

I have been monitoring this for a few weeks now:

Best regards

En Jie
Title: Re: TCPDF errors related to VM products
Post by: jaak69 on January 18, 2017, 10:30:36 AM
Hello

I ran with VM 3.0.18 and JM3.6.5 and TCPDF library from Virtuemart 3.0.18 package (com_tcpdf_1.0.2.zip - tcpdf library 6.2.12) into the same
QuoteTCPDF ERROR: [Image] Unable to get the size of the image: .......
problem in my live site.

My site is based on Joomlart JA Hawkstore template.

For probing I made fresh localhost install from JA Hawkstore quickstart (J 3.4.8 and VM 3.0.9), update Joomla and Virtuemart. Here tcpdf library version is 6.0.096 + several additional files copared with com_tcpdf_1.0.2.zip
After that I deleted from  my livesite /libraries/tcpdf folder, copied from fresh installation the tcpdf folder to live site and pdf's for products started to work.

Because pdf's for products did't work with com_tcpdf_1.0.2 and Protostar template either, I'm afraid that some misconfiguration is inside  com_tcpdf_1.0.2 library.

Jaak
Title: Re: TCPDF errors related to VM products
Post by: Studio 42 on January 18, 2017, 12:24:25 PM
Try to use jpg image, to be sure it's not a image format compatibility issue.