How can I use pdf2image to create TIFFs of PDF pages separated by colour channel?

Q:

I need something that will convert PDFs to one-channel tiffs – each colour separately (1 page pdf becomes four grayscale tiffs, magenta, cyan, black, yellow). And I would like it to be just a folder that I can drag the PDFs to and then it does its job and saves the TIFFs in another folder.

A:
Here’s how to do so on Windows:

  1. Install pdf2image (http://www.pdftron.com/pdf2image/downloads.html) and ImageMagick (http://www.imagemagick.org/download/).

  2. Create three directories: “input”, “output_cmyk”, and “output_sep”.

  3. Dump your PDFs into the “input” directory.

  4. Run the following commands from a DOS window:

pdf2image --cmyk -f tif -o output_cmyk input/*.pdf
for %f in (output_cmyk*.tif) do (convert %f -colorspace CMYK -separate output_sep%~nf_%d.tif)

Now, your “output_cmyk” directory will contain the four-channel TIFFs, and the “output_sep” directory will contain the separated one-channel TIFFs.