GNOME Bugzilla – Bug 301432
New PDF files have large gap at top of image
Last modified: 2008-01-15 12:52:40 UTC
Please describe the problem: Recent PDF files (with Digital Rights Applied) do not render properly in either GIMP or ImageMagick. I suspect this is in some common PDF library but do not know which one. These PDF files were probably created with the Nov. 2004 Update 3 of Adobe PDF, or possibly some expensive Adobe product. Steps to reproduce: 1. Go to www.irs.gov website 2. Download any current 2004 PDF tax form (example: 2004 1040) 3. Open in GIMP. Actual results: Observe large, incorrect margin at top of PDF. Expected results: Render correctly, as in Adobe Acrobat 7 beta for Linux. Does this happen every time? Yes Other information: I verified that older tax forms from 2002 and 2003 still work correctly, therefore I assume it is the PDF creation software (Adobe) that has changed and broken GIMP and ImageMagick. These PDF files when opened in Adobe state "this PDF has digital rights applied so you can save the filled in version even with the free Adobe Reader". Perhaps GIMP is rendering the digital rights section instead of ignoring it.
GIMP uses ghostscript to render the PDF, you should try with this software. AFAIK ImageMagick also uses ghostscript as the delegate for PDF (and Postscript, btw): http://www.cs.wisc.edu/~ghost/ Version 8.51 has been released on monday, maybe it behaves differently. Try to convert PDF to an image format using ghostscript directly - if this is successful and doesn't show the gap, reopen the bug.
This is actually a flaw in the PDF. It relies on implementation defined behavior. Newer ghostscript versions can let us patch Acrobat Reader though.
Fixed in both branches. 2005-04-21 Manish Singh <yosh@gimp.org> * plug-ins/common/postscript.c: pass -dUseCropBox when loading PDF files, to match Acrobat Reader's behavior in honoring CropBox over MediaBox. Fixes bug #301432.
One can also set -dUseCropBox in GS_OPTIONS in the environment, as a workaround until a new version is released. You'll need ghostscript 8 or higher for this to work though.