topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday November 4, 2024, 6:27 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: detect color in pdf  (Read 6107 times)

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,824
    • View Profile
    • Donate to Member
detect color in pdf
« on: April 06, 2012, 02:15 PM »
hello!

is it possible to detect if a pdf file has any non-black color? ie. it is not black and white?

thanks!

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
Re: detect color in pdf
« Reply #1 on: April 06, 2012, 04:49 PM »
congratulations on your membership :-)
Sorry to hear you are colour blind :-(


kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,824
    • View Profile
    • Donate to Member
Re: detect color in pdf
« Reply #2 on: April 07, 2012, 05:25 PM »
anyone??

x16wda

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 888
  • what am I doing in this handbasket?
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: detect color in pdf
« Reply #3 on: April 07, 2012, 05:40 PM »
what about grayscale, would that count?
vi vi vi - editor of the beast

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,824
    • View Profile
    • Donate to Member
Re: detect color in pdf
« Reply #4 on: April 07, 2012, 05:55 PM »
what about grayscale, would that count?

I want to distinguish pdfs that contain black characters, lines, table borders, etc, from those containing any grayscale or other color apart from black and white

x16wda

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 888
  • what am I doing in this handbasket?
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: detect color in pdf
« Reply #5 on: April 07, 2012, 06:52 PM »
OK, next question, what is the framework?  Do you want a batch utility to do this and return a result you can check, or documentation on what to look for to incorporate into a routine you are writing, or ??
vi vi vi - editor of the beast

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,824
    • View Profile
    • Donate to Member
Re: detect color in pdf
« Reply #6 on: April 07, 2012, 06:56 PM »
yes, a utility or any other way to inform me that the pdf is only black and white
it would be best not to have to open the pdf (since it will be a batch process and it must be fast and quiet)
also checking the colors of its pixels, may not be accurate enough

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,824
    • View Profile
    • Donate to Member
Re: detect color in pdf
« Reply #7 on: April 12, 2012, 07:27 AM »
anyone?

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,964
    • View Profile
    • Donate to Member
Re: detect color in pdf
« Reply #8 on: April 12, 2012, 08:09 AM »
I'm curious why you need this kalos.

Related:
A few years back I sent a PDF for publication, it was vector "line-art" (black only) with "Black" text - it should have been treated as a one colour (Black) print, but for some reason the file insisted on been treated as full colour at their end (or maybe it was their layout software that insisted on treating it so). I dont really have much experience in this field, and the person I was dealing with at the publishers didnt really seem to be much of an expert either. We narrowed it down to the text, but couldnt figure out why it was so (as said, it was simply black text). To be honest I cant remember what exactly our solution was, we converted the file to "greyscale"/Black in some manner.

So, anyways, just curious :)
Also, if there is a solution, I'll certainly have a go at checking some PDFs... out of cusiousity :p
Tom

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,824
    • View Profile
    • Donate to Member
Re: detect color in pdf
« Reply #9 on: April 12, 2012, 10:03 AM »
One purpose would be my request long time ago, to send colored pages to color printer and the black ones to b/w printer

But, moreover, now, and I have a program that outputs pdfs, and and if it has a colored element, and it means that it belongs to a certain category and must be treated specifically

For automation purposes in brief.. :)