Building Thumbnails for PDFs

<Note: thanks to Buffy Miller for giving me a much slicker solution here>

Often I want to post a PDF on a web page, but would like the cover of the PDF to be the clickable element.  This just makes things look slicker.  This can easily be done with the imagemagick set of commands.  Using imagemagick, you can select the page you want to convert out of the pdf (using the [] annotation), get the right size (using -resize) and format (based on file extension).  The following command does the conversion in a single go:

convert -resize 150 inputfile.pdf[0] outputfile.png

One of these days I’ll get around to making a mediawiki extension that does that by default for pdf media attachments.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s