To use ImageMagick, download and install the program. (Note that during the installation you will need to add the tools to the path.) If you want to do operations on PDF, postscript or EPS files, you will also need Ghostscript. Open a command prompt in Windows.
I'll demonstrate how to create thumbnails from the first page of a PDF file:
convert -thumbnail x100 "File.pdf[0]" File.thumb.pngThis creates a thumbnail File.thumb.png from the first page of the file File.pdf. [0] instructs convert to use the first page. If you leave off the [0] part thumbnails will be created for every page in the PDF. The thumbnail height is 100 pixels, and the width is automatically determined.
If you want to automate this, you can use command line batch processing, MATLAB, or my favorite scripting language, Perl:
foreach my $file (glob("$ARGV[0]/*.pdf"))
{
print "Converting $file\n";
print `convert -thumbnail 133x100 "${file}[0]" ${file}.png`;
}
No comments:
Post a Comment