Page 1 of 1

Splitting pdf documents into seperate pages

PostPosted: Mon Oct 03, 2005 4:24 pm
by forhire
Today I needed to split up another pdf catalog for the web. I found that ghost script can do quite nicely so I wrote this quick script to create the individual pages and thumbnails.

for count in `seq $2`
echo Creating PDF $count.pdf
gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -dFirstPage=$count -dLastPage=$count -sOutputFile=$count.pdf $1
echo Creating jpeg thumbnail $count.jpg
convert -resize 100x100 $count.pdf $count.jpg