Creating thumbnails from PDF pages
Posted: Wed Apr 13, 2005 9:11 pm
Today I had about 40 PDF pages I needed to index and place on the web. I wanted to create jpeg thumbnails of each page... simple right? It took a little searching but I found an article that explained out to use GhostScript and ImageMagick to do it. So off to sourceforge for I went for ImageMagick.
This is a link to the article:
http://www.hawaiianharddrive.com/articl ... icleid=394
After finding that indeed it did work... I started converting, but after 4 or 5 pages I decided there must be a better way. And there was. I wrote a DOS batch file. Yes DOS in the year 2005. One big long line because I'm lazy:
for %%f in (*.pdf) do if not exist %%~nf.jpg convert.exe -resize 100x100 %%f %%~nf.jpg
You can leave out the "if" statement if you wish.
That's that hack of the day
BTW: this is the page I was working on:
http://www.gaelsong.com/GCart/index.cfm ... pdfcatalog
This is a link to the article:
http://www.hawaiianharddrive.com/articl ... icleid=394
After finding that indeed it did work... I started converting, but after 4 or 5 pages I decided there must be a better way. And there was. I wrote a DOS batch file. Yes DOS in the year 2005. One big long line because I'm lazy:
for %%f in (*.pdf) do if not exist %%~nf.jpg convert.exe -resize 100x100 %%f %%~nf.jpg
You can leave out the "if" statement if you wish.
That's that hack of the day
BTW: this is the page I was working on:
http://www.gaelsong.com/GCart/index.cfm ... pdfcatalog