I'm pretty sure I've found a bug in the PDF compression settings. I was experiencing the problem referenced here ( http://www.pdfforge.org/forum/help/4704-pdf-format-and-dpi ) and did some testing. Here is what I found.
First of all, the resample function apparently works something like the following, in case someone is trying to figure out how to get smaller images/files. Correct me if I get something wrong.
1. DPI setting (either encoded in the JPEG/PNG or calculated from image size/number of pixels?) is compared to the specified resolution.
2. If image DPI is 2X or more than the specified resolution limit, it is downsampled by the following factor:
3. The number of pixels in the image is reduced by the largest possible integer factor that still keeps the image DPI above the specified resolution limit.
4. Either "downsample" or "average downsample" algorithm applied
Take for example a 4", 2800 pixel wide image. DPI=2800/4=700. If you resample this with a specified resolution limit of 300dpi, it will be downsampled (factor of 2) to 1400 pixels, or 1400/4 = 350dpi. If you specify a 200 dpi limit, it will be downsampled (factor of 3) to 933 pixels, or 933/4 = 233dpi. A 600dpi limit results in no downsampling.
Now for the bug:
Everything works fine for a color image. However, if you feed it a pure greyscale image, no resampling takes place.
IMPORTANT item to note: It matters what application you use to test this. I discovered it while using a Crystal Report viewer used by an internal application. On the other hand, when I tested with Photoshop, Photoshop seems to convert to color somehow, as the image gets downsampled. However, the open source ImageJ (a scientific image analysis program, http://rsb.info.nih.gov/ij/ ) must send accurate data. Using that software, color images get downsampled, greyscale images don't.
Choose "Black & White" in the printer proeprties.
Well, that does force a downsampling on the image, but doesn't solve the problem.
We create documents that have a mix of color and greyscale images. If I change the printer settings to b/w, the color images are no longer color in the PDF, although they all seem to get resampled. If I leave the printer settings as color, the color images are resampled, but the greyscale images aren't.
The printer driver converts greyscaled images to color images. So the color image compressions settings are used for this images.
Hmmm. Consider the following:
1. I took a large color image (3498 pixels), converted to grey, and saved, so both files were available.
2. Used OpenOffice.org to create a document. Placed color image on page 1 and greyscale image on page 2. OpenOffice.org defaulted to a width of 6.93 inches, resulting in 505dpi for both images. I left it as is.
3. Printed to PDFCreator (color output; color resample=240dpi, greyscale resample=240dpi)
4. Resulting PDF has a resampled color image (1749pix, 253dpi) on page 1 and a NON-resampled greyscale image (still 3498pix, 505dpi) on page 2.
This doesn't sound like the intended behavior. Obviously, the greyscale image is not geting resampled. My guess is some software DOES covert grey to color before sending it to the printer driver, but that it's happening in the application, and not the printer driver.
(Note: if you don't use OpenOffice.org and don't want to install it, there is a portable version available at portableapps.com )
Would a dev like for me to email a PDF that demonstrates this bug?
On vacation this week, and can't send any files till next week. I described a way I could reproducibly get the problem above with OpenOffice.org if you want to try.
I'll send a file next week. How/to what address should I send it?
For me everything works well with Photoshop so I didn't even notice that problem. However - some people might have problems, so someone, please fix it.
I confirm this as a bug. I just upgraded from 0.9.7 to 1.0.1 and my 225kB PDF grew to 978kB with the same settings (JPG Medium, Avg downsample, 144 dpi (for both colour and greyscale)). I’m printing a two-page doc from Word 2002, which is colour on one side and B&W on the other. If I change my one greyscale image to colour (in Word) then the file size comes back to 225kB. It seems the greyscale settings are being ignored, but in 0.9.7 they were working.
Send me some sample files. Which application use you for printing?
I'm now back from vacation, and have caught up with mandatory work. Do you still need a sample file? If so, send to where?
This problem still happens in PDFCreator version 1.4.3 I reproduced it with LibreOffice Writer 3.5.0 Test files are here: https://dl.dropbox.com/u/67354005/Hummingbird.odt https://dl.dropbox.com/u/67354005/Hummingbird_Colour.pdf https://dl.dropbox.com/u/67354005/Hummingbird_Greyscale.pdf The original image was a 150kB JPG. The ODT file is 151kB; The colour PDF (Image compression 'JPEG Medium', factor 0.5, Average Downsample, 108dpi) is 30kB The PDF with image set to Greyscale (same compression options as above for greyscale images) is 452k.
This problem still happens in PDFCreator version 1.4.3
I reproduced it with LibreOffice Writer 3.5.0
Test files are here:
The original image was a 150kB JPG.
The ODT file is 151kB;
The colour PDF (Image compression 'JPEG Medium', factor 0.5, Average Downsample, 108dpi) is 30kB
The PDF with image set to Greyscale (same compression options as above for greyscale images) is 452kB.
please try with version 1.5.0,
I just tested printing your sample and results are:
One thing that i noticed,I was getting an error when opening with MSWord and it needed to "repair" the file, which actually decreased the filesize to 131 kb.
So if the problem still persists for you in version 1.5.0, please try printing from a different application to make sure its not an app related problem.
Thanks Robin. Unfortunately I still get the same file sizes from LibreOffice Writer and Word XP (with a different but equivalent test file). As I said in my first post, this was originally working fine from Word XP with PDFCreator 0.9.7. Are there intermediate files, or anything else I can give you to help track this down?
sorry that it is taking so long, but I still havn´t been able to recreate this behaviour.
You could send us the .ps and .inf file (%user%\appdata\local\temp\pdfcreator\spool), that would be great.