If you install this netpbm pet from
http://murga-linux.com/puppy/viewtopic. ... 552#815552
you'll be able to run this:
Code: Select all
#!/bin/sh
# Location and title:
# ~/my-applications/bin/pdf2thumb-1b.sh
# (c) musher0, 2014-12-17
####
# set -xv
dirpath=${@%/*}
NOMFICHIER="`basename "$1" | cut -d. -f1`"
pdftops -f 1 -l 2 "$@"
cd $dirpath
pstopnm -xsize=700 -ysize=900 -portrait $NOMFICHIER.ps
# -dpi=300, no.
# These little pnm* executables are pretty fussy, so
# we have to take the winding road.
for i in `ls -1 $NOMFICHIER*.ppm`;do
pamscale 0.9 $i > "`basename $i | cut -d. -f1`".pnm
# This is barely readable...
# Still, for real thumbnails, parameter can be from 0.1 to 0.3
done
for i in `ls -1 $NOMFICHIER*.pnm`;do
pamcut -top=150 -right=500 $i > "`basename $i | cut -d. -f1`".pmm
done
for i in `ls -1 $NOMFICHIER*.pmm`;do
pamtojpeg2k $i > "`basename $i | cut -d. -f1`".jpg
done
wait
rm -f *.p?m
rm -f *.ps
mtpaint -v "$NOMFICHIER"00?.jpg
# defaultimageviewer "$NOMFICHIER"00?.jpg
# set +xv
####
# Final note.
# Usage from cli:
# pdf2thumb.sh <nameof>.pdf
pamtojpeg2k from the recent netpbm-10.67 suite. These newer utilities allow us to get
a much better balanced page.
Final note: the resulting jpg image (of the script process) needs to be loaded and
saved in mtpaint before it can be shown proprely in gpicview or gqview.
BFN.
musher0