Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

snapshot image from PDF document

I want to make a snapshot image from an arbitrary page (i.e. not necessarily the first) in a PDF document. Any free tools for this? I'm using Delphi.
TIA
Steven

like image 361
stevenvh Avatar asked Jun 05 '09 10:06

stevenvh


1 Answers

You can do this in 2 steps using pdftk and ImageMagick/Ghostscript

Step 1: Create a new pdf file with the page you are interested in:

pdftk.exe file.pdf cat 2 output page2_only.pdf

Step 2: Convert the new pdf to jpg:

convert -geometry 1600x1600 -density 200x200 -quality 100 page2_only.pdf page_snapshot.jpg

convert is an ImageMagick command.

ImageMagick requires Ghostscript to be installed in order for this to work. When I tested this, convert complained about invalid formatting of the PDF, caused by pdftk, but this did not seem to affect the output.

like image 69
Francois Gravel Avatar answered Nov 11 '22 20:11

Francois Gravel