Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

How can I detect color PDFs vs. black and white?

Question

We need to programatically identify color PDFs vs. black and white PDFs so that they can be processed differently.

Answer

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.

This should allow you to determine if a PDF files color or black and white.

There isn't a document wide setting that could help you determine if a PDF has color or is just black and white, as various different objects have their own properties.


© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum