Closed (fixed)
Project:
Printer, email and PDF versions
Version:
6.x-1.4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Apr 2009 at 15:54 UTC
Updated:
6 May 2009 at 21:30 UTC
After hearing you saying many times that dompdf has problems, I decided to switch to TCPDF. It works better for me now, but I still got this error
TCPDF ERROR: [Image] No such file or directory in /home/greatbre/public_html/sites/default/files/images/Product%20-%20Founders%20Red's%20Rye.preview.jpg
You can test it here. Printer-friendly version works fine. But PDF reported the error.
Comments
Comment #1
boabjohn commentedMy impression is that the problems with images (and I have them as well) is somehow wrapped up in the 3rd party PDF utilities, thus there is little chance of problem resolution through this channel.
I have tried both dom and TCPDF and get different (but fatal) errors with each. It doesn't look like there's an easy solution through either utility.
Here's a sample error from my site:
TCPDF ERROR: [Image] No such file or directory in /home/boab-info/htdocs/drupal/sites/ruralpracticechange.boab.info/files/00-intro-title-campbell-sm.jpg?1229090688
Note: there is an image called "00-intro-title-campbell-sm.jpg" in the path specified, but what the "?1229090688" means or where it comes from is totally opaque to me.
THEREFORE: my question (without breaking the intent of the current thread) is to ask...is there a way to selectively include/hide the Print PDF option on selected content types?
This will allow me to provide PDF options on types where it currently works (eg, simple css, low image load) and avoid it on content types where I have known problems.
Thanks,
JB
Comment #2
jcnventura@skyredwang: TCPDF doesn't have problems with your "image filenames with spaces" as dompdf did, but I do think it has a problem with single quotes.. I will try to commit something soon that will fix that. I'll notify you here when I do.
@boabjohn: your problem is the same as reported in #420460: problem with images with a numerical query. I really do need to know from where that numerical query is coming from.. Can you please provide any answers to that in the proper issue?
João
Comment #3
jcnventuraActually, after developing the fix, I decided that I really shouldn't be trying to fix problems with TCPDF inside the module (Pandora's box and all...)..
Please create an issue for the problem of single quotes in image filenames in TCPDF's issue queue. TCPDF's maintainer is usually fast in fixing things on his side.
João
Comment #4
skyredwangissue reported https://sourceforge.net/tracker/?func=detail&aid=2765894&group_id=128076...
Comment #5
skyredwangI have this conversation with the developer; he suggested it's a problem of implementation. https://sourceforge.net/tracker/?func=detail&atid=710532&aid=2765894&gro...
skyred :I was instructed to report an issue here about problem of single quotes in image filenames. details at http://drupal.org/node/429054
you can see the error here http://greatbrewers.com/list/47413
Nicola Asuni (nicolaasuni):I'm unable to reproduce the problem.
You are probably using an old TCPDF version, please upgrade.
I've created a file name with both spaces and quotes and the following
examples are working fine:
$pdf->Image('../images/image demo\'s.jpg', 50, 50, 100, 150, '',
height="150" />', 1);
height="150" />', 1)
'http://www.tcpdf.org', '', true, 150);
$pdf->writeHTML('
$pdf->writeHTML('
skyred:I updated TCPDF to the april.15 version. The problem remains.
http://greatbrewers.com/list/47413
Nicola Asuni (nicolaasuni):As you can see from the test I've used, TCPDF is working fine.
You probably have a problem on TCPDF implementation.
Comment #6
skyredwangI thought TCPDF expected the implementation layer to escape the single quotes in the image filename.
Comment #7
jcnventuraThat's what the fix I did was doing.. It worked, but the problem is that if I start fixing everything that TCPDF can't handle I will end up with a lot of code in the module side which will eventually be obsoleted once TCPDF starts to handle it. This is a bug with TCPDF and has to be fixed by TCPDF.
I will try to come up with an example which doesn't involve Drupal so that Nicola can see that the problem is his code and not the 'TCPDF implementation'. Until then, sorry but you're between a rock and a hard place.. The easiest solution for you is to stop using single quotes in your filenames.
Anyway, this will all become moot once I test and merge #419296: Use wkhtmltopdf for PDF generation. I am pretty sure that everyone will kiss TCPDF and dompdf goodbye at that point.
João
Comment #8
skyredwangwkhtmltopdf for PDF generation sounds really exciting
Comment #9
jcnventuraI have upgraded to TCPDF 4.5.0043 yesterday and the problem of the single quotes is fixed in that version. Something that Nicola did between 4.5.0032 and 4.5.0043 solved it (possibly this fix on 0036: All tag attributes, such as p align="center" must be enclosed within double quotes.).
So, Nicola was right on that bug report in Sourceforge, there's nothing to be done on his side.
Have you tried with TCPDF 4.5.0043 or later? Is it still giving you problems?
João
Comment #10
skyredwangI upgraded TCPDF to
Name: TCPDF
Version: 4.6.001
Release date: 2009-04-17
But the problem remains. Take a closer look at the error
TCPDF ERROR: [Image] No such file or directory in /home/greatbre/public_html/sites/default/files/images/Product%20-%20Founders%20Red's%20Rye.thumbnail.jpg
the single quote in the file name wasn't escaped like
\'Comment #11
jcnventuraIndeed, you're right.. When I tried to reproduce the problem, what happened to me was the reported missing filename was truncated at the single quote. In your case that's clearly not the problem.
The bad part is that I don't know where to look for in trying to reproduce it.. Have you tried removing the quote in the filename? It would be nice to know if the problem is still related to the quote or if it has nothing to do with it.
João
Comment #12
skyredwangConfirm: after removing the quote in the filename, TCPDF works.
Comment #13
jcnventuraAt least something is the problem... I don't have time now to search our history of issues... Can you tell me if you're using the public or the private filesystem method?
I did test both types in my earlier testing, but it would speed up the problem somewhat if I could limit myself to a single one.
João
Comment #14
skyredwangI am using public filesystem method. Please feel free to let me know if you need anything.
Comment #15
jcnventuraThere is indeed one thing you could do... I think I need to try a PDF of your page, and not my (simpler) pages to try to find out what the problem is.. Can you please enable the printer-friendly version for anonymous users so that I can access it? I will try to access http://greatbrewers.com/list/47413.
If you need to, please delete/comment out the build_mode = NODE_BUILD_PRINT line.
João
Comment #16
skyredwangI am really sorry that I forgot the permission again.
http://greatbrewers.com/list/47413 is working now, because I got rid of the single quote in the filename.
http://greatbrewers.com/list/47708 is another broken one.
Comment #17
jcnventuraThanks for the URL. I tracked the problem down to something in Drupal replacing the ' in the filenames with &# 039;. I have added some code to decode that into normal characters so that TCPDF understands it.
João