Given a PDF file with color and black & white pages, is there any way with C# to find out among the given pages which are color and which are black & white?
Short of parsing all the postscript content, probably not. There's no flag on a PDF page that says it is or is not b&w or color. So you'd have to check the color of every element placed on the page to figure out if it was color or not. I'm not sure what libraries exist for reading PDFs on C# but you would need one that will read all the elements.
Similarly, any images you have on the page would need to be checked for color and that is not simple. Color image formats can hold b&w images.
My recommendation is to render each page to an image and then check each pixel for RGB values not equal to each other. If R=G=B for each pixel then it's a grayscale image.
You could then perform actions (such as extracting a page to another document or printing the page) on the pages based on whether they are color pages or black and white pages, etc.
This can be achieved by using my companies PDF developer library, Quick PDF, or potentially by one of the open source PDF libraries that Kenneth suggested.
Check out:
I use his tools for text extraction and pdf analysis. Very inexpensive, royalty free, and work well. I think GetPDFColourStyle as part of the PDFLayoutPlus library should do the trick.