Monday, April 25, 2011

Linux tool: convert

The system I'm using uses the linux utility convert to convert pdfs to jpgs. My box gives me the following error.

>$ convert Badge-1114044091.pdf Badge-1114044091.jpg
convert: Postscript delegate failed `Badge-1114044091.pdf'.
convert: missing an image filename `Badge-1114044091.jpg'.

But the production machine does not. According to

>$ convert -version

my version is the same as the prodution machine. I'm not sure exactly how to check if postscript needs to be updated. Not really a huge linux guru.

EDIT: Upon suggestion, I checked Ghostscript. The following was already installed.

>$ gs -version
ESP Ghostscript 8.15.3 (2006-08-25)
Copyright (C) 2004 artofcode LLC, Benicia, CA.  All rights reserved.
From stackoverflow
  • Install GhostScript.

    http://www.ghostscript.com/


    ImageMagick (the 'convert' utility) doesn't actually convert PDFs; it invokes GhostScript using an arcane command like

    gs -q -sDEVICE=jpeg -dBATCH -dNOPAUSE -dFirstPage=1 -dLastPage=1 -r<OUTPUT RESOLUTION> -sOutputFile=<OUTPUT>.jpg <INPUT>.pdf 2>&1
    

    You might want to try that command directly if you want more control.

    Drew : This is the result of trying that command. Should I try reinstalling ghostscript? >$ gs -q -sDEVICE=jpeg -dBATCH -dNOPAUSE -dFirstPage=1 -dLastPage=1 -sOutputFile=Badge1008140412.jpg Badge1008140412.pdf 2>&1 Segmentation fault
    rjh : Command works for me with gs version 8.63 (from Ubuntu repositories).
    rjh : ...try without the -q option, see what is output before it dies.
    Drew : ESP Ghostscript 815.03 (2006-08-25) Copyright (C) 2004 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 Segmentation fault Not much more help...
    Drew : Upgrading Ghostscript seemed to do the job. Accepting for leading me to Ghostscript.

0 comments:

Post a Comment