I was using imagemagick but couldnt reference a particular page.
After an hour of messing I made a break through.
The line you put up there does the trick but if the PDF has 100 pages then it makes an animated gif with all hundred pages.
To get around this you need
convert -resize 100x100 -thumbnail 100x100 my_pdf.pdf[0] thumb.jpg
of course my_pdf.pdf[0] makes a thumb from the first page of the PDF. So one and all if your using this through php's exec function make sure you reference the page by sticking an array element on the end of the PDF where [0] = page 1 [10] = page 11 etc, otherwise you will no doubt kill the server.
Any how if you dont want do do it through php I knocked up a simple little shell script to do the same thing.
Code:
#!/bin/bash
for dir in *
do
cd $dir
echo "in $dir"
for subdir in *
do
cd $subdir
echo "in $subdir"
for file in `ls *.pdf`
do
echo "thumb nailing $file ..."
convert -resize 120x120 $file[0] 120x120 $file.gif
done
cd ..
done
cd ..
done
On my server the pdf are stored in the folders
Rootdir
backcopies
Topdir
200* I.E 2001, 2002
subdir
Jan - Dec
The script should work providing you start in the root dir.
Ibbo
|