PDF CropBox/MediaBox

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
magick
Site Admin
Posts: 11077
Joined: 2003-05-31T11:32:55-07:00

Post by magick » 2006-03-08T11:35:52-07:00

The solution to the problem is to strip the MediaBox from the PDF or edit the ImageMagick source, coders/pdf.c. Remove the MediaBox check from ReadPDFImage() and rebuild/reinstall. Alternatively you can download ImageMagick 6.2.6-4 Beta within a few days and add this to your command line:
  • -define pdf:use-cropbox=true

User avatar
magick
Site Admin
Posts: 11077
Joined: 2003-05-31T11:32:55-07:00

Post by magick » 2006-05-07T08:20:22-07:00

Try upgrading your version of Ghostscript. If that does not make a difference this may work:
  • convert -define pdf:use-cropbox=true 1005.pdf -delete 1-99 sizetest.jpg

User avatar
magick
Site Admin
Posts: 11077
Joined: 2003-05-31T11:32:55-07:00

Post by magick » 2006-05-07T11:00:22-07:00

Our recommendation is to use the Ghostscript program directly and bypass ImageMagick.

User avatar
magick
Site Admin
Posts: 11077
Joined: 2003-05-31T11:32:55-07:00

Post by magick » 2006-05-07T12:16:46-07:00

Yes you can use Ghostscript to convert directly to JPEG. See the Ghostscript forums to determine how this is done. Add -verbose to your convert command to see the options ImageMagick passes to Ghostscript.

Post Reply