Using ImageMagick’s Convert to create a thumbnail of a PDF

Written by James McDonald

February 12, 2017

Sometimes you need to create a thumbnail of a PDF file for display on the web or elsewhere. Here is the ImageMagick convert command to do it.

convert \
-density 600 \ # make it high density so the resized image looks OK
example_051.pdf[2] \ # use [X] to specify the page number page 3 in this case
-resize x150 \ # resize to a height of 150 keeping the width ratio the same
-flatten \ # flatten the image so that the transparent areas aren't blacked out
out.jpg \ # the name of the output image

example_051

Refs:
tcpdf.org
http://www.binarytides.com/convert-pdf-image-imagemagick-php/

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Network speed test host to host

On Ubuntu / Debian apt-get install iperf3 On Windows download it from https://iperf.fr/iperf-download.php#windows Make...