since I updated from print-6.x-1.16 to print-6.x-1.17 I receive following error
TCPDF ERROR: [Image] Unable to get image: http://sites/default/files/logo.png
I've already checked permission for the logo file and his folder. Downgrading to print-6.x-1.16 solves the issue.

Comments

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

There shouldn't be any difference between the two, except if your logo path starts with '//'. In that case, because of the fix to #1542056: Image not found when using img src=//www.something.com/image.jpg, your current protocol would be prepended to the logo URL.

Is this your case?

Anonymous’s picture

I've tried to use a user logo (path /sites/default/files/print_logo.png)
I also tried to use the default theme's logo
The issue still persists.

jcnventura’s picture

Does it work if you replace the print.pages.inc file with the one from 6.x-1.16?

Anonymous’s picture

replacing print.pages.inc from 6.x-1.16 to 6.x-1.17 solves the issue

jcnventura’s picture

OK, that helps to narrow it down to one possible explanation: somewhere in your page, there's an image that just during the PDF pre-process has a path/URL that starts with "//".. As pointed out in another issue, to complete a URL that starts with a double-slash, it's necessary to add the protocol schema.

Did you select the no logo option when you tested the different possibilities? I'd like to make sure the logo isn't being included somewhere else.

Anonymous’s picture

this are the cases:
no logo: it produces the pdf with text and images
theme logo: TCPDF ERROR: [Image] Unable to get image
custom logo: TCPDF ERROR: [Image] Unable to get image

jcnventura’s picture

Title: TCPDF ERROR: [Image] Unable to get image » TCPDF ERROR: [Image] Unable to get image on logo
Status: Postponed (maintainer needs more info) » Active

OK. Thanks a lot for your help.

I've got all I needed to know.. Still can't reproduce it though.

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

One final question: what's the version of TCPDF that you've got installed?

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Active

tcpdf_5_9_162, but I also tried with tcpdf_5_9_160

foutrelis’s picture

It looks like theme_image (called from print.pages.inc:237) is changing the URL from '/sites/default/files/site_logo.png' to '//sites/default/files/site_logo.png' (note the added forward slash at the beginning).

This is not related to PDF generation, as the double slash in the logo appears in the normal "print" page as well.

I'm guessing this is the offending change:

http://drupalcode.org/project/print.git/commitdiff/2ead48b70754c30be9c1f...

jcnventura’s picture

Status: Active » Closed (duplicate)

Indeed it is, and another user (Nor4a) provided a patch for it in #1626878: Logo not showing up in the print pages after upgrade to 6.x-1.17.

Marking this as a duplicate of that one, as his patch fixed this issue as well.

jcnventura’s picture

Issue summary: View changes

.

omar alahmed’s picture

make sure that this folder is writable: default\files\print_pdf\tcpdf\cache

when my folder became writable, the problem is solved.

the source: http://stackoverflow.com/questions/7665540/tcpdf-error-image-unable-to-g...