Page 1 of 1

Text disappearing when converting from PDF to JPG

Posted: 2020-03-05T09:02:50-07:00
by kxayrnqohbqvnakmru
I have a document that is mostly text that I am having trouble converting.

ImageMagick 6.4.3 2013-03-20 (I know this is old but I don't have the option to upgrade it)

Tried on a newer version and it didn't have this problem.
ImageMagick 7.0.7-34 Q16 x86_64 20180520

The input looks a lot like this. 99% of the text is very sharp, but there are a few words that appear as if they were not processed when the scanner generated it's output file.

Here's what the output file looks like. Mostly empty, except for these few bits of text.

Here's the command I'm running and the output.
convert -verbose -density 200 -resize 36% -quality 70 test.pdf test.jpg

"gs" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r200x200" -dFirstPage=1 -dLastPage=1 "-sOutputFile=magick-XXiM0Xex" "-fmagick-XXCgAJUH" "-fmagick-XXbSKAAS"

Any ideas?

Re: Text disappearing when converting from PDF to JPG

Posted: 2020-03-05T10:07:25-07:00
by fmw42
IM 6.4.3 from 2013 is ancient. Certainly likely there could be an issue. Also check the version of Ghostscript and perhaps try to upgrade that. Otherwise, you will need to upgrade IM.

Try proper syntax ordering:

Code: Select all

convert -verbose -density 200 test.pdf -resize 36% -quality 70 test.jpg
For IM 7, use magick in place of convert