How do I get a comma-separated list of all color pages in my PDF file?
Thanks to this answer I can get a list of all Page numbers and a note for a color page.
gs -o - -sDEVICE=inkcov input.pdf | grep -v "^ 0.00000 0.00000 0.00000" | \
grep "^ \|^Page"
The output would be:
Page 1 0.16646 0.16261 0.14122 0.13507 CMYK OK Page 2 Page 3 0.48488 0.48728 0.48794 0.16678 CMYK OK Page 4 0.47346 0.47703 0.47624 0.46490 CMYK OK Page 5
How do I modify the output to return just the pages with color in a comma-separated list?
The result should looks something like that:
1, 3, 4