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

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
gopsmaheta99
Forum Newbie
Posts: 2
Joined: Tue Jun 27, 2017 7:42 am

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

Post 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
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

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

Post by Christopher »

The PDF is a text file. Have you thought of searching it for color tags?
(#10850)
gopsmaheta99
Forum Newbie
Posts: 2
Joined: Tue Jun 27, 2017 7:42 am

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

Post by gopsmaheta99 »

Pdf if either text or image.
I don't know what to do with that.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

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

Post by Christopher »

Search for PDF tags that set color. Any embedded images would need to be scanned for color pixels.
(#10850)
Post Reply