You can use Ghostscript. Run it with the tiffsep
or tiffsep1
device at 72dpi resolution. This will create separate TIFF files for each CMYK colorant which you can then further use to 'count' the coverage for each color:
gswin32c.exe ^
-sDEVICE=tiffsep ^
-r72x72 ^
-o "c:/path/to/output/dir/page_%03d.tif" ^
c:/path/to/input.pdf
This device creates multiple output files. It creates:
- one 32bit composite CMYK file (tiff32nc format, which is 32bit CMYK [8bits/component]), plus
- multiple tiffgray files -- a tiffgray (which is 8bit gray, LZW compressed) for each color separation.
The tiffgray files are LZW compressed. The -sOutputFile=...
-specified filename will be the CMYK file. Names of separation 'tiffgray' files for CMYK colorants will have appended '.Cyan.tif', '.Magenta.tif' '.Yellow.tif' and '.Black.tif' to that name. tiffsep also recognizes spot colors automatically and creates additional tiffgray separations for them; the names of these have a number appended. (You can also pre-determine the names by passing -sSeparationColorNames
on the commandline -- but you better read up the details in Ghostscript's documentation, file Devices.htm).
If you use the tiffsep1
output device, the result will be similar -- the difference is that you will get only the gray separations (no 32bit composite CMYK), but these will be TIFF G4 files (G4 compression scheme).
You can change the compression scheme by adding -sCompression=lzw
(or one of none | crle | g3 | g4 | pack
). Be aware that using =none
for compression will create files of equal sizes for each separation colorant.