Tuesday, 11 August 2009

One Liner: Convert PDF to PNG

I needed to convert all the pdf files in a few directories to png files, so I used the following one liner:

find . -name "*.pdf" -type f -maxdepth 2|while read file;do convert ${file} $(echo ${file} |perl -ne "chomp;s/pdf/png/;print");done

It requires that you have ImageMagick installed.

No comments:

Post a Comment