LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   ImageMagick/Ghostscript Troubles (https://www.linuxquestions.org/questions/linux-software-2/imagemagick-ghostscript-troubles-439124/)

Rayaru 04-26-2006 03:47 PM

ImageMagick/Ghostscript Troubles
 
Hi all,

I'm trying to convert a PDF document to a JPG image using ImageMagick. The file is called "front.pdf" and I want to convert it to "front.jpg." When I use the convert command, I am getting an error:

Code:

$ convert front.pdf front.jpg
Error: /undefined in --filter--
Operand stack:
  --dict:7/7(L)--  false  false  --dict:10/14(L)--  --nostringval--  --nostringval--  JPXDecode
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  1  3  %oparray_pop  --nostringval--  2  1  1  --nostringval--  %for_pos_int_continue  --nostringval--  --nostringval--  --nostringval--  %array_continue  --nostringval--  false  1  %stopped_push  --nostringval--  %loop_continue  --nostringval--  6851  2  11  %oparray_pop  --nostringval--  false  1  %stopped_push  2  11  %oparray_pop  --nostringval--  --nostringval--  --dict:0/0(L)--  --nostringval--  false  1  %stopped_push  --nostringval--  %loop_continue  --nostringval--  182845  2  12  %oparray_pop  --nostringval--  false  1  %stopped_push  2  12  %oparray_pop  --nostringval--  --nostringval--  --dict:3/3(L)--  --nostringval--  false  1  %stopped_push  --nostringval--  %loop_continue  --nostringval--  182239  --nostringval--  --nostringval--  --nostringval--  --nostringval--  --nostringval--  --nostringval--  %array_continue  7  14  %oparray_pop  --nostringval--  --nostringval--
Dictionary stack:
  --dict:1072/1123(ro)(G)--  --dict:0/20(G)--  --dict:93/200(L)--  --dict:93/200(L)--  --dict:97/127(ro)(G)--  --dict:229/230(ro)(G)--  --dict:19/24(L)--  --dict:4/6(L)--  --dict:20/31(L)--  --dict:14/20(L)--  --dict:1/1(ro)(G)--  --dict:1/1(ro)(G)--  --dict:1/1(ro)(G)--  --dict:7/16(L)--
Current allocation mode is local
GNU Ghostscript 7.07: Unrecoverable error, exit code 1
convert: Postscript delegate failed `front.pdf'.

Any help would be greatly appreciated!

jlinkels 04-27-2006 04:02 PM

Should work.

It is either a pdf in non-standard format, or too new a format. Or you have a version of convert which contains a bug.

Code:

jlinkels@jlinkels_pc:~$ convert -version
Version: ImageMagick 6.0.6 11/29/04 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2004 ImageMagick Studio LLC

Just tried a conversion and it works without a problem. I created the pdf from a ps file using ps2pdf.

jlinkels

maroonbaboon 04-27-2006 10:19 PM

I am guessing that Imagemagick itself cannot display PDF directly, but needs a helper app like Ghostscript.

Ghostscript should be able to generate a jpeg directly, with something like

$ gs -sDEVICE=jpeg -o image.jpg file.pdf

Command 'gs -h' shows all the output 'devices' for Ghostscript, including various other image formats.

jpwdesigns 12-17-2008 06:08 PM

Ghostscript error
 
HI Im getting a similar error and cant find any help anywhere.
This same script works on some pdf and not on others and i cant seem to figure out why or how to get it to work on all of the pdf im needing images from.

heres the error:
Code:

[root@XXXXXX files]# gs -SDEVICE=jpeg -r72 -sOutputFile=../img/newsletter/asid_occ_summer2008.jpg -dNOPAUSE -dBATCH -dGraphicsAlphaBits=4 -dUseCIEColor -dLastPage=1 -- asid_occ_summer2008.pdf
GNU Ghostscript 7.07 (2003-05-17)
Copyright (C) 2003 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
Error: /undefined in --filter--
Operand stack:
  --dict:9/9(L)--  false  false  --dict:10/14(L)--  --nostringval--  --nostringval--  JPXDecode
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  1  3  %oparray_pop  --nostringval--  2  1  1  --nostringval--  %for_pos_int_continue  --nostringval--  --nostringval--  --nostringval--  %array_continue  --nostringval--  false  1  %stopped_push  --nostringval--  %loop_continue  --nostringval--  5918  --nostringval--  --nostringval--  --nostringval--  --nostringval--  --nostringval--  --nostringval--  %array_continue  7  11  %oparray_pop  --nostringval--  --nostringval--
Dictionary stack:
  --dict:1064/1123(ro)(G)--  --dict:0/20(G)--  --dict:74/200(L)--  --dict:74/200(L)--  --dict:97/127(ro)(G)--  --dict:229/230(ro)(G)--  --dict:19/24(L)--  --dict:4/6(L)--  --dict:20/31(L)--  --dict:1/1(ro)(G)--  --dict:7/16(L)--
Current allocation mode is local
GNU Ghostscript 7.07: Unrecoverable error, exit code 1



All times are GMT -5. The time now is 07:34 AM.