pdfGetNumColorSpaces

Get the number of PDF color space types.
int pdfGetNumColorSpaces(PDFHandle pdf)
The available color space types are defined by the PDF specification. As of PDF 1.7, they are: The pdfGetNumColorSpaces and pdfGetColorSpaceName functions return the items in the list above. (In general, that list won't change - i.e., pdfGetNumColorSpaces and pdfGetColorSpaceName will always return the same values - but future revisions to the PDF spec may add color space types, and XpdfAnalyze will be updated to match.)

The pdfGetImageInfo function returns a color space type, which is an integer in 0 .. n-1, where n is the value returned by pdfGetNumColorSpaces.

C:
char *name; int i, n; n = pdfGetNumColorSpaces(pdf); for (i = 0; i < n; ++i) { name = pdfGetColorSpaceName(pdf, i); printf("color space type %d: %s\n", i, name); }
pdfGetColorSpaceName
pdfGetImageInfo