Closed (fixed)
Project:
Printer, email and PDF versions
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Aug 2009 at 17:50 UTC
Updated:
18 Sep 2009 at 07:40 UTC
Comments
Comment #1
peterx commentedI have a site with print 6x-1.8 and dompdf 0.5.1. Jpegs display in PDFs but not PNG images. The PDF contains the correct space for the PNG image and the space is blank, there is no red cross. PNGs appear in the print version. Converting a PNG to jpeg in Gimp produces a file that works in PDF. Avondrood, what type of images are you using?
Comment #2
peterx commentedSee also http://www.martinvseticka.eu/index.php?sekce=browse&page=160 for a similar sounding problem.
Found a PNG related issue. I will try dompdf_0-5-2 for the PNG problem.
Comment #3
peterx commenteddompdf_0-5-2 converted both PNG and Jpeg to big red crosses. Back to 0.5.1.
Comment #4
Avondrood commentedThank you for your input. I'm using PNG and Jpeg files. Both formats are not displayed.
Comment #5
Avondrood commentedI've tried TCPDF in stead of DomPDF, this seems to solve this particular problem.
Comment #6
charlie-s commentedI'm using TCPDF as well to solve this problem, but a new problem has emerged from it -- half of my images are displayed so large that only 20-30% of the image is on the pdf, the rest falls off-screen. Frantically researching this issue now...
Comment #7
ryan_courtnage commentedIf you are experiencing problems with broken images, and you are using dompdf, this may help you.
I've discovered that dompdf-0.5.1 will not display PNG images that have transparency. Remove the transparency and the PNG will display just fine.
dompdf-0.5.2_alpha1 seems to have problems displaying my PNG images, regardless of transparency. It's just an alpha version though, some bugs are to be expected.
tcpdf didn't have a problem with transparent PNG (for me anyways)
Comment #8
peterx commentedThe PNGs are screen prints from Gimp and should not have transparency. I will look at the Gimp defaults and creating a test PNG with no alpha channel.
Comment #9
Avondrood commentedI've found a solution. TCPDF caused similar resolution-problems as described by Charlie1234: images with a resolution higher than 72 dpi, which displayed correctly on-screen, were displayed too big in the PDF-file. This made me return to the original problem with dompdf 0.5.1. I've implemented the fix PeterX proposed: http://www.martinvseticka.eu/index.php?sekce=browse&page=160 and tested the PDF-generator. Still no images. As an experiment, I manually created the "tmp" folder mentioned in the fix and now it works like a charm! The location of the tmp-folder is print/lib/tmp and writing permissions should be set. Thank you for your trouble!
Comment #10
peterx commentedI converted a PNG from RGB to indexed using Gimp and the image appears in the PDF. The image size is halved. Unfortunately Gimp does not let you count the number of colours in an image and does not let you set more than 256 colours when you index the image. My test image has two curved colour areas requiring about 500 colours. Gimp chooses to change the most common colours, two large flat areas of light grey to horrible beige. Some of the other images will require more colours. I might have to reinstall my ten year old copy of Paintshop Pro.
Layer > Transparency > Remove Alpha Channel
Reduced image from 36KB to 33KB and the image works in PDF. Why does Gimp create an alpha channel for images with no transparency? Weird. I wonder if there is an option to change the default?
I can now go back to using dompdf 0.5.1 and CSS. For my current use, deleting the alpha channel is of more benefit than #9 because deleting the alpha channel also reduces the image size.
Comment #11
charlie-s commented@peter FWIW, Gimp and Photoshop both set Transparency=on by default when saving PNGs, regardless of whether or not transparency channel is being used.
Two important things to keep in mind is keep the DPI @ 72 and NO SPACES IN FILENAMES OF IMAGES!
Comment #12
jcnventuraSo I guess this is fixed..