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: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

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: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

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: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Our recommendation is to use the Ghostscript program directly and bypass ImageMagick.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

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