Page 1 of 1

How to count color and b/w pages from pdf ?

Posted: Tue Jun 27, 2017 7:46 am
by gopsmaheta99
Hello Guys, I have a general question about count color and b/w pages from pdf ? In brief about this, I have implemented this functionality using imagick. What imagick(imagemagic) do is first convert each of pdf pages into image and checking into image whether colored or black/white.

It executed one command in for loop according to pdf pages which cause server down.

Please anyone can tell me solution of this question except IMAGICK.

I even used ghostscript but it counts gray page as color page so its not as much useful also used Verypdf and setasign but they are costly.

Please tell me solution over linux server that can count pages directly using command over linux server. Thanks. Gopal

Re: How to count color and b/w pages from pdf ?

Posted: Tue Jun 27, 2017 7:56 pm
by Christopher
The PDF is a text file. Have you thought of searching it for color tags?

Re: How to count color and b/w pages from pdf ?

Posted: Wed Jun 28, 2017 12:53 am
by gopsmaheta99
Pdf if either text or image.
I don't know what to do with that.

Re: How to count color and b/w pages from pdf ?

Posted: Sat Jul 01, 2017 3:34 pm
by Christopher
Search for PDF tags that set color. Any embedded images would need to be scanned for color pixels.