1

I'm trying to convert a PDF to TIFF

$ convert -density 300 mydoc.pdf[0] -depth 8 -strip -background white -alpha off mydoc.tiff

But I am getting this error :

convert-im6.q16: FailedToExecuteCommand `'gs' -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r300x300' -dFirstPage=1 -dLastPage=1 '-sOutputFile=/tmp/magick-7634jYcQFgAWFuMP%d' '-f/tmp/magick-7634mHbM1fZhBVNJ' '-f/tmp/magick-7634ZhGvd52RltPD'' (-1) @ error/delegate.c/ExternalDelegateCommand/462.
convert-im6.q16: no images defined `mydoc.tiff' @ error/convert.c/ConvertImageCommand/3258.

I am using this version of gs and ImageMagick:

gs -v
GPL Ghostscript 9.26 (2018-11-20)
Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.

convert --version
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 
http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib

And I am on Ubuntu 18.04.1.

Can someone help me ?

BlackNocte
  • 11
  • 7
  • It looks like ImageMagick cannot find Ghostscript, since the Delegates does not list gs or gslib. If it is really installed where ImageMagick can find it, then the other issue would be as described at https://stackoverflow.com/questions/52861946/imagemagick-not-authorized-to-convert-pdf-to-an-image/52863413#52863413 – fmw42 Dec 03 '18 at 17:42
  • I ran into the same problem today. Strange thing is that if I run the command without requesting the first page only (`file.pdf[0]`) it runs just fine and produces PNG images for each page. Strange. – PeS Dec 03 '18 at 23:08
  • Possible duplicate of [ghostscript 9.26 update breaks imagick readImage for multipage PDF](https://stackoverflow.com/questions/53560755/ghostscript-9-26-update-breaks-imagick-readimage-for-multipage-pdf) – KenS Dec 04 '18 at 00:41
  • duplicate of https://stackoverflow.com/questions/53560755/ghostscript-9-26-update-breaks-imagick-readimage-for-multipage-pdf – KenS Dec 04 '18 at 00:41
  • I tried using the solution on ghostscript 9.26 update breaks imagick readImage for multipage PDF and indeed I could convert my pdf but the text was badly convert like a simple word became '$5',//<&('(; – BlackNocte Dec 04 '18 at 11:45

0 Answers0