Error converting PDF
Posted: 2018-11-30T22:10:13-07:00
I'm running ubuntu 14.04 and have imagemagick 6.77 and ghostscript 9.26 installed and am trying to extract the first page of some PDFs to a JPEG, basically grabbing the first page as a JPG.
I've allowed "read" to the "delegate" domain for the various postscript file formats in policy.xml:
It works fine for some but I've come across an error that I've not seen before in my limited experience with IM 6.77:
This kind of looks like it's saying there was an error running the ghostscript "gs" command, is that correct? If so is there anyway to tell the convert command to not remove what I'm assuming are the intermediate files that it is creating to feed to the "gs" command so I can try to debug it?
Or, even better, does anyone recognize what might be wrong here?
Many thanks!
I've allowed "read" to the "delegate" domain for the various postscript file formats in policy.xml:
Code: Select all
<policy domain="coder" rights="read" pattern="PS" />
<policy domain="delegate" rights="read" pattern="PS" />
<policy domain="coder" rights="read" pattern="PDF" />
<policy domain="delegate" rights="read" pattern="PDF" />
<policy domain="coder" rights="read" pattern="EPS" />
<policy domain="coder" rights="read" pattern="XPS" />
<policy domain="delegate" rights="read" pattern="EPS" />
<policy domain="delegate" rights="read" pattern="XPS" />
Code: Select all
convert /tmp/dfXvOyQHR0[0] -resample 72 /tmp/foo.jpg
convert.im6: `%s' (%d) "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -dFirstPage=1 -dLastPage=1 "-sOutputFile=/tmp/magick-0RtsLKdr--0000001" "-f/tmp/magick-RTEH2AAB" "-f/tmp/magick-tLKIPwXL" @ error/utility.c/SystemCommand/1890.
convert.im6: Postscript delegate failed `/tmp/dfXvOyQHR0': No such file or directory @ error/pdf.c/ReadPDFImage/677.
convert.im6: no images defined `/tmp/foo.jpg' @ error/convert.c/ConvertImageCommand/3044.
Or, even better, does anyone recognize what might be wrong here?
Many thanks!