The "convert" utility of ImageMagick is also capable of converting Postscript and PDF to images. The utility calls Ghostscript for doing this. With current Ghostscript it does not work any more (regression). See https://bugs.launchpad.net/ubuntu/+source/imagemagick/+bug/128801 convert pdfaccess.pdf pdfaccess.png gives simply Error: /undefined in obj (full error output in the Ubuntu bug report). This occurs with any PDF file.
I assume pdfaccess.pdf is http://www.adobe.com/products/acrobat/pdfs/pdfaccess.pdf After running 'make install' with ghostscript-8.60rc1 on my x86_64 Ubuntu 7.04 system, I cannot reproduce.
This works for me on Cygwin with ImageMagick 6.3.0 convert and 8.60 rc1
I was able to reproduce with the packaged ghostscript and imagemagick on today's gutsy, x86 arch. After running 'make install' with r8159 the conversion completed fine, so the bug is resolved upstream.
I still have the bug on ghostscript 8.61 (svn 8187) and Imagemagick 7:6.2.4.5, under packaged versions in gutsy 64 bits. convert -verbose fig3-4.pdf fig3-4c.png Error: /undefined in --run-- Operand stack: --dict:6/15(L)-- CairoFont-1-0 1 --dict:8/8(L)-- --dict:8/8(L)-- 2194 --dict:8/8(L)-- false --dict:8/11(L)-- Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1889 1 3 %oparray_pop 1888 1 3 %oparray_pop 1872 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 1 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push --nostringval-- Dictionary stack: --dict:1156/1684(ro)(G)-- --dict:2/20(G)-- --dict:97/200 (L)-- --dict:97/200(L)-- --dict:106/127(ro)(G)-- --dict:274/300(ro) (G)-- --dict:21/25(L)-- --dict:4/6(L)-- --dict:20/20(L)-- --dict:1/1 (ro)(G)-- --dict:10/13(L)-- --dict:1156/1684(ro)(G)-- --dict:5/5 (L)-- --dict:6/6(ro)(G)-- --dict:97/200(L)-- --dict:1156/1684(ro) (G)-- --dict:5/5(L)-- Current allocation mode is local Last OS error: 2 GPL Ghostscript SVN PRE-RELEASE 8.61: Unrecoverable error, exit code 1 "gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g504x1224" "-r72x72" "-sOutputFile=/tmp/magick-XX9T2SDX" "-f/tmp/magick-XXAJhT6r" "-f/tmp/magic8DGTat"Start of Image Define Huffman Table 0x00 0 1 5 1 1 1 1 1 1 0 0 0 0 0 0 0 Define Huffman Table 0x01 0 3 1 1 1 1 1 1 1 1 1 0 0 0 0 0 Define Huffman Table 0x10 0 2 1 3 3 2 4 3 5 5 4 4 0 0 1 125 Define Huffman Table 0x11 0 2 1 2 4 4 3 4 7 5 4 4 0 1 2 119 End Of Image convert: Postscript delegate failed `fig3-4.pdf'.
Can you check with the final Ghostscript 8.61 (if you do not want to compile it, get a live CD of Ubuntu Hardy Alpha 1 which should be released today)?
Created attachment 3591 [details] PDF file I'm trying to convert to png.
I compiled the latest gs and the bug seems to be still there for me (kubuntu gutsy 64 bits): convert -verbose fig3-4.pdf fig3-4d.png Error: /undefined in --run-- Operand stack: --nostringval-- --dict:6/15(L)-- CairoFont-1-0 1 --dict:8/8(L)-- --dict:8/8(L)-- 2194 --dict:8/8(L)-- false --dict:8/11(L)-- Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1905 1 3 %oparray_pop 1904 1 3 %oparray_pop 1888 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 1 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push --nostringval-- Dictionary stack: --dict:1150/1684(ro)(G)-- --dict:2/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:107/127(ro)(G)-- --dict:275/300(ro)(G)-- --dict:22/25(L)-- --dict:4/6(L)-- --dict:21/40(L)-- --dict:1/1(ro)(G)-- --dict:10/13(L)-- --dict:1150/1684(ro)(G)-- --dict:5/5(L)-- --dict:6/6(ro)(G)-- --dict:75/200(L)-- --dict:1150/1684(ro)(G)-- --dict:5/5(L)-- Current allocation mode is local Last OS error: 2 GPL Ghostscript 8.61: Unrecoverable error, exit code 1 "gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g504x1224" "-r72x72" "-sOutputFile=/tmp/magick-XXxkYoKQ" "-f/tmp/magick-XX7pl1xy" "-f/tmp/magicqQBOW8"Start of Image Define Huffman Table 0x00 0 1 5 1 1 1 1 1 1 0 0 0 0 0 0 0 Define Huffman Table 0x01 0 3 1 1 1 1 1 1 1 1 1 0 0 0 0 0 Define Huffman Table 0x10 0 2 1 3 3 2 4 3 5 5 4 4 0 0 1 125 Define Huffman Table 0x11 0 2 1 2 4 4 3 4 7 5 4 4 0 1 2 119 End Of Image convert: Postscript delegate failed `fig3-4.pdf'. ___________ For the records, my install procedure: I untared the source to ~/mybins/ and did: sudo apt-get install autoconf libcupsimage2-dev libcupsys2-dev cd ~/mybins/ghostscript-8.61 chmod a+X autogen.sh ./autogen.sh ./configure make sudo mv /usr/bin/gs /usr/bin/gs_861_2007-08-02 sudo cp ./bin/gs /usr/bin/gs
I don't believe this is fixed. With the current head (r8439) and this command line bin/gs -sDEVICE=ppmraw -sOutputFile=test.ppm ./689372.pdf I receive the same error as Comment #7. I've duplicated this on casper and on my amd64 box.
The sample file attached as a comment #7 fails on recent versions of Ghostscript but the problem is not related to ImageMagick. New problem now tracked as a bug 689615. If there's no other issues with ImageMagic this bug report can be closed.
I have tested ImageMagick-6.3.7 (compiled from sources on x86 Linux) with the current Ghostscript with the patch for the bug 689615 and it works just fine with the sample file from the comment #7.