pdfCheckPageColorUsage
Analyze a page for color usage.
int pdfCheckPageColorUsage(PDFHandle pdf, int page)
The pdfCheckPageColorUsage function analyzes the specified page in the
PDF file, and returns one of the following values:
- 1 - if the page is monochrome (black & white)
- 2 - if the page is grayscale
- 3 - if the page is color
- 0 - on error (e.g., invalid page number)
C:
int color;
color = pdfCheckPageColorUsage(pdf, pageNum);
if (color == 1) {
/* monochrome */
...
} else if (color == 2) {
/* grayscale */
...
} else if (color == 3) {
/* color */
...
} else {
/* error */
...
}