Detect if PDF is colored [DATALOGICS][APDFL]

275 Views Asked by At

I am using APDFL 10.1.0 to convert PDF to images. This is how I am loading the PDF file and saving a specific page as image:

Document pdfdocument = null;
pdfdocument = new Document(docpath);
Page docpage = pdfdocument.GetPage(pagelist[0]);
Image pageimage = docpage.GetImage(PageRect);

Is there a way to detect from either the docpage variable or the pageimage variable if the specific page is colored or is grayscale?

1

There are 1 best solutions below

0
On

You can use pageImage.NumberComponents to determine this. Color Images will have 3 or 4 components (depending on whether it is an RGB Image or a CMYK Image) while grayscale Images will have 1 component.