CommandException: 'gs' while trying to convert
-
- Posts: 6
- Joined: 2017-12-19T22:26:52-07:00
- Authentication code: 1152
CommandException: 'gs' while trying to convert
Hello everyone,
I tried to convert pdf to image but got this error message:
org.im4java.core.CommandException: 'gs' -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r144x144' '-sOutputFile=/var/folders/n9/ykgrcs6n60vd805mr6mrnv0h0000gn/T/magick-1294bYHYFtaChjfp%d' '-f/var/folders/n9/ykgrcs6n60vd805mr6mrnv0h0000gn/T/magick-1294EQono57J3WJo' '-f/var/folders/n9/ykgrcs6n60vd805mr6mrnv0h0000gn/T/magick-1294yqfBAFSG3Vzl'
I am trying to figure out the problem. Any idea what's the problem?
Thank you
Joshana Shakya
I tried to convert pdf to image but got this error message:
org.im4java.core.CommandException: 'gs' -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r144x144' '-sOutputFile=/var/folders/n9/ykgrcs6n60vd805mr6mrnv0h0000gn/T/magick-1294bYHYFtaChjfp%d' '-f/var/folders/n9/ykgrcs6n60vd805mr6mrnv0h0000gn/T/magick-1294EQono57J3WJo' '-f/var/folders/n9/ykgrcs6n60vd805mr6mrnv0h0000gn/T/magick-1294yqfBAFSG3Vzl'
I am trying to figure out the problem. Any idea what's the problem?
Thank you
Joshana Shakya
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: CommandException: 'gs' while trying to convert
It generally helps if you say what version IM you use, on what platform.
But the answer is that IM delegates reading PDF files to Ghostscript. If you haven't installed Ghostscript, that's the problem.
But the answer is that IM delegates reading PDF files to Ghostscript. If you haven't installed Ghostscript, that's the problem.
snibgo's IM pages: im.snibgo.com
-
- Posts: 6
- Joined: 2017-12-19T22:26:52-07:00
- Authentication code: 1152
Re: CommandException: 'gs' while trying to convert
I have installed ghostscript and it worked.
-
- Posts: 6
- Joined: 2017-12-19T22:26:52-07:00
- Authentication code: 1152
Re: CommandException: 'gs' while trying to convert
Though I have been able to convert pdf to image after installation of ghostscript, I got the error message:
org.im4java.core.CommandException: org.im4java.core.CommandException: "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r144x144" "-sOutputFile=/tmp/magick-469rWKTCxMHK7kT%d" "-f/tmp/magick-469jHztSM3q9nR9" "-f/tmp/magick-469_QtQgeUXyLnq"
trying to convert 1K pdf to image at once. Any idea how to solve this problem?
I am using 6.8.9 version and java platform.
Thanks
org.im4java.core.CommandException: org.im4java.core.CommandException: "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r144x144" "-sOutputFile=/tmp/magick-469rWKTCxMHK7kT%d" "-f/tmp/magick-469jHztSM3q9nR9" "-f/tmp/magick-469_QtQgeUXyLnq"
trying to convert 1K pdf to image at once. Any idea how to solve this problem?
I am using 6.8.9 version and java platform.
Thanks
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: CommandException: 'gs' while trying to convert
What was your exact command line?
-
- Posts: 6
- Joined: 2017-12-19T22:26:52-07:00
- Authentication code: 1152
Re: CommandException: 'gs' while trying to convert
I used run() method of org.im4java.core.ConvertCmd class in java 8 platform. And the exception occurred infrequently while converting those pdfs of size 44.6MB.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: CommandException: 'gs' while trying to convert
Perhaps you are running out of memory or tmp space.
-
- Posts: 6
- Joined: 2017-12-19T22:26:52-07:00
- Authentication code: 1152
Re: CommandException: 'gs' while trying to convert
Any idea to solve this problem?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: CommandException: 'gs' while trying to convert
First, find the cause of the problem. 45MB is large for a PDF, so I suspect as Fred says, you ran out of memory or /tmp. How many pages in the PDF, how many pixels per page? At 8 bytes per pixel, how much memory does that take?joshanashakya wrote:Any idea to solve this problem?
snibgo's IM pages: im.snibgo.com
-
- Posts: 6
- Joined: 2017-12-19T22:26:52-07:00
- Authentication code: 1152
Re: CommandException: 'gs' while trying to convert
Thanks, i am trying to solve.