Had the need recently to generate a bunch of thumbnails for some PDFs we had. ImageMagick to the rescue.

for P in `ls *.pdf`
  do echo $P
  outfile="thumbs/`echo $P|cut -d . -f 1`.jpg"
  convert -quality 50 -geometry 64x82 $P[0] $outfile

The [0] tells it to only do the first page, and the quality setting of 50 created thumbnails that were only 2-4K, but still quite functional for the purpose.

If not already pulled in as a dependency, Ghostscript (/usr/bin/gs) will need to be installed too.


comments powered by Disqus