pdfGetNumColorSpaceObjects
Get the number of objects drawn in a particular color space type.
int pdfGetNumColorSpaceObjects(PDFHandle pdf, int page, int idx)
The available color space types are defined by the PDF
specification. As of PDF 1.7, they are:
- DeviceGray
- CalGray
- DeviceRGB
- CalRGB
- DeviceCMYK
- Lab
- ICCBased
- Indexed
- Separation
- DeviceN
- Pattern
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 XpdfRasterizer will be updated to
match.)
The pdfGetNumColorSpaceObjects
function will return the
number of objects drawn in a specified color space type on a specified
page.
C:
int i, n, k;
n = pdfGetNumColorSpaces(pdf);
for (i = 0; i < n; ++i) {
name = pdfGetColorSpaceName(pdf, i);
k = pdfGetNumColorSpaceObjects(pdf, page, i);
printf("%d objects drawn in the %s color space type\n",
count, name);
}