To create image thumbnails from a PDF document, run this in a terminal window:
$ convert -thumbnail x300 -background white -alpha remove input_file.pdf[0] output_thumbnail.png
The parameters to convert do the following things:
Parameter | Effect |
---|---|
-thumbnail | Similar to -resize, but optimized for speed and strips metadata. |
x300 | Make the thumbnail 300px tall, and whatever width maintains the aspect ratio. |
-background white | Sets the thumbnail background to white. |
-alpha remove | Removes the alpha channel from the thumbnail output. |
input_file.pdf | The PDF file to use as input. |
[0] | The page number of the input file to use for the thumbnail. |
output_thumbnail.png | The output thumbnail file to create. |
If you want larger thumbnails, just change the x300
parameter to match. If you want to output .jpg’s (or anything else, like .gif), just change the file …