-define PDF:use-cropbox-true doesn't recognize cropbox

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
donovaly
Posts: 43
Joined: 2004-10-04T16:24:55-07:00

-define PDF:use-cropbox-true doesn't recognize cropbox

Post by donovaly »

Take the following two PDF-files:

http://fkurth.de/uwest/usti/PGMEA.pdf
http://fkurth.de/uwest/usti/PGMEA-2.pdf

and convert them with the following command to a PNG:

convert -define pdf:use-cropbox=true PGMEA.pdf PGMEA.png

The file PGMEA-2.pdf is in PDF format 1.4 and Imagemagick correctly recognized its cropbox.
But the file PGMEA.pdf is in PDF format 1.2 and Imagemagick ignored or didn't recognized its cropbox so that the resulting PNG is too large, see the results:

http://fkurth.de/uwest/usti/PGMEA.png
http://fkurth.de/uwest/usti/PGMEA-2.png

I'm using Imagemagick 6.2.8-7.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

PGMEA.pdf does not contain a cropbox.
donovaly
Posts: 43
Joined: 2004-10-04T16:24:55-07:00

Post by donovaly »

magick wrote: PGMEA.pdf does not contain a cropbox.


Sorry I misspelled, both images have a mediabox with exactly the size of the drawing:

/MediaBox[0 0 124 78]

Open both PDFs with Adobe Reader or GSview and you'll see that they are displayed the same.
The bug is that Imagemagick doesn't take care of the PDF size in case of the PDF in format 1.2. Ghostscript (8.54) handle both files correctly.
donovaly
Posts: 43
Joined: 2004-10-04T16:24:55-07:00

Post by donovaly »

magick wrote: PGMEA.pdf does not contain a cropbox.


Sorry I misspelled, both images have a mediabox with exactly the size of the drawing:

/MediaBox[0 0 124 78]

Open both PDFs with Adobe Reader or GSview and you'll see that they are displayed the same.
The bug is that Imagemagick doesn't take care of the PDF size in case of the PDF in format 1.2. Ghostscript (8.54) handle both files correctly.
donovaly
Posts: 43
Joined: 2004-10-04T16:24:55-07:00

Post by donovaly »

I just realized that this bugdoesn't occur when I omit the PDF crop box option and simply use the command

convert PGMEA.pdf PGMEA.png

But I need the cropbox option for my other PDF-images and use only one script to convert them automatically.
donovaly
Posts: 43
Joined: 2004-10-04T16:24:55-07:00

Post by donovaly »

This bug still occurs with Imagemagick 6.2.9-2.
Post Reply