Get all colors used in PDF file

Hi,

I have given a task to get all colors used in the pdfs. The color used in the pdfs can be CMYK, CMYK spot color, PANTONE color etc.

Actually I want to collect the names of all colors into an list type array. Can anyone help me to write applescript code to get these colors.

Thanks in advance,

Regards,
Gopal

I have tried to do this in the past but Acrobat is not very applescript friendly. I was successful getting spot color information from InDesign but again I ran into a problem where InDesign can not tell the difference between CMYK and CYK or CK or MK. If all you need to know is if CMYK is true or false and what spot colors used this is pretty easy to do. If you are trying to find out what plates the job will be I would suggest a more in-depth approach that would use Photoshop and get actual channel information.

This information is in the PDF header, load the PDF into a variable and parse out the document colors. There should be a listing of document CMYK colors, custom colors, and RGB colors. See this thread [http://bbs.macscripter.net/viewtopic.php?id=24650] for a bit more information.

That link isn’t working anymore. Is there a way to get the PDF header using AppleScript? I’ve been simply reading the data of a PDF and then parsing out the information I need to find out the spot colours used. However when I read a really large PDF (e.g. 185MG), the data is so much, my script editor crashes.

e.g. Try this script:


set ThisFile to choose file
set TheData to read ThisFile

on the two files contained in this link:
https://www.dropbox.com/s/8hmanajuf57ttx3/success%20and%20fail%20files.zip?dl=0
One works, the other fails for me, at least it kind of works but then crashes Script Editor.

Is there a convenient way to find out the colour information from a PDF using AppleScript? Getting the PDF header sounds promising but I can’t find a way to do this.

It seems to be a Adobe Illustrator work.
Adobe Illustrator can open and edit PDFs.

At first, you have to try open it by Adobe Illustrator.