ImageMagick to the rescue on batch PDF conversion

Posted Oct. 11, 2008 | batchprocessing, imagemagick, pdf, terminal

I had a ton of raw scanned documents that I needed as individual PDFs. I also needed to make them monochrome for optimization purposes (we’re talking about 8-10mb per page here). After a bit of poking around, I discovered that ImageMagick can actually spit out PDFs. This was my first time using it from the terminal, but it ended up being a very good experience. So, the final command?

mogrify -monochrome -scale x1100 -density 100 -format pdf *.pnm

The command is pretty straightforward (mogrify is IM’s way of doing batch commands, btw). I just settled on a resolution that was sufficient (then calculated the height I needed… 11 inches times 100 dots per inch equals 1100).

It took about 5-10 seconds per image, which even counting research was far less then manual processing would have cost. On top of that I learned something new today!