Imagemagick PDF to JPG conversion failing

Posted by sbressler on Stack Overflow See other posts from Stack Overflow or by sbressler
Published on 2010-03-30T08:30:18Z Indexed on 2010/03/30 8:33 UTC
Read the original article Hit count: 614

Filed under:
|
|
|
|

I'm trying to convert the first page of a PDF to a JPG. I'm pretty sure I got this to work with certain PDFs, but is it really possible that certain PDFs are made incorrectly and cannot be converted?

I tried running this first:

$ convert 10-03-26.pdf[1] test.jpg

And I got the follow:

Error: /syntaxerror in readxref
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1062/1417(ro)(G)--   --dict:0/20(G)--   --dict:73/200(L)--   --dict:73/200(L)--   --dict:97/127(ro)(G)--   --dict:229/230(ro)(G)--   --dict:14/15(L)--
Current allocation mode is local
ESP Ghostscript 7.07.1: Unrecoverable error, exit code 1
convert: Postscript delegate failed `10-03-26.pdf'.

Running this instead:

$ convert -verbose -colorspace rgb '10-03-26.pdf[1]' test.jpg

I get the following:

Error: /syntaxerror in readxref
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1062/1417(ro)(G)--   --dict:0/20(G)--   --dict:73/200(L)--   --dict:73/200(L)--   --dict:97/127(ro)(G)--   --dict:229/230(ro)(G)--   --dict:14/15(L)--
Current allocation mode is local
ESP Ghostscript 7.07.1: Unrecoverable error, exit code 1
"gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g792x1611" "-r72x72" -dFirstPage=2 -dLastPage=2 "-sOutputFile=/tmp/magick-XXU3T44P" "-f/tmp/magick-XXoMKL8Z" "-f/tmp/magic2eec1F"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 `10-03-26.pdf'.

Why would the conversion fail?

Thanks!

© Stack Overflow or respective owner

Imagemagick PDF to JPG conversion failing

Posted by Scott on Super User See other posts from Super User or by Scott
Published on 2010-03-30T19:07:59Z Indexed on 2010/03/30 19:13 UTC
Read the original article Hit count: 614

Filed under:
|
|
|

I'm trying to convert the first page of a PDF to a JPG. I'm pretty sure I got this to work with certain PDFs, but is it really possible that certain PDFs are made incorrectly and cannot be converted?

I tried running this first:

$ convert 10-03-26.pdf[1] test.jpg

And I got the follow:

Error: /syntaxerror in readxref
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1062/1417(ro)(G)--   --dict:0/20(G)--   --dict:73/200(L)--   --dict:73/200(L)--   --dict:97/127(ro)(G)--   --dict:229/230(ro)(G)--   --dict:14/15(L)--
Current allocation mode is local
ESP Ghostscript 7.07.1: Unrecoverable error, exit code 1
convert: Postscript delegate failed `10-03-26.pdf'.

Running this instead:

$ convert -verbose -colorspace rgb '10-03-26.pdf[1]' test.jpg

I get the following:

Error: /syntaxerror in readxref
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1062/1417(ro)(G)--   --dict:0/20(G)--   --dict:73/200(L)--   --dict:73/200(L)--   --dict:97/127(ro)(G)--   --dict:229/230(ro)(G)--   --dict:14/15(L)--
Current allocation mode is local
ESP Ghostscript 7.07.1: Unrecoverable error, exit code 1
"gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g792x1611" "-r72x72" -dFirstPage=2 -dLastPage=2 "-sOutputFile=/tmp/magick-XXU3T44P" "-f/tmp/magick-XXoMKL8Z" "-f/tmp/magic2eec1F"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 `10-03-26.pdf'.

Why would the conversion fail?

Just as an aside, this is happening on a (gs) Grid-Service on (mt) Media Temple hosting. I cannot install programs on the server, but both Imagemagick and Ghostscript are installed

Thanks!

© Super User or respective owner

Related posts about imagemagick

Related posts about ghostscript