Created
July 6, 2009 07:22
-
-
Save fajran/141313 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Create thumbnails of a PDF file | |
# | |
# Author: Fajran Iman Rusadi <fajran@gmail.com> | |
# License: Public domain | |
# Requirements: poppler-utils imagemagick | |
# Usage: pdf2thumbnail input.pdf output-prefix- size | |
# e.g. pdf2thumbnail input.pdf thumbnail- 400 | |
INPUT=$1 | |
PREFIX=$2 | |
SIZE=$3 | |
TOTAL=`pdfinfo $INPUT | grep ^Pages | awk '{ print $2 }'` | |
echo "Total pages: $TOTAL" | |
for i in `seq 1 $TOTAL` | |
do | |
pdftoppm -f $i -l $i $INPUT | convert -thumbnail $SIZE - $PREFIX$i.png | |
echo -n "$i " | |
done | |
echo | |
echo done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment