Convert PDF2PNG with Imagick

#!/usr/bin/perl -w
# Needs Imagick convert and Perl to run
    #get all pdf from current directory
        opendir($DIR, ".");
	     @files = grep(/\.pdf$/,readdir($DIR));

#convert all pdf to png with 300 dpi
       foreach $file (@files) {
       system("convert -density 300x300 $file $dir[0].png");
This entry was posted in Linux, Perl, simpleScripts. Bookmark the permalink.

One Response to Convert PDF2PNG with Imagick

  1. laubb says:

    the density option is important – as the default of convert usually creates some low res raster images.

Leave a Reply

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

You are commenting using your 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 )

Google+ photo

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

Connecting to %s