Script to Read Used Pantone Colors from AI / EPS file?
We have a library of several thousand EPS and AI files. We are trying to create a script that will extract the Pantone colors from the meta data in the file. Just looking through some examples it seems really inconsistent on where the Pantone values are stored and we're having trouble identifying what is actually used in the image vs an unused color in the Swatches.
E.g., there is no red in the image for this file and it doesn't have a %%DocumentCustomColors tag:
%%CMYKCustomColor: 0.058822598308325 1 0 0 (PANTONE Rhodamine Red CVC) %%CMYKProcessColor: 0.899999976158142 0.479999989271164 0 0 (PANTONE 285 CP)
But another file has them all in one place:
%%DocumentCustomColors: (PANTONE 123 CVC)
%%+ (PANTONE 1795 CVC)
%%+ (PANTONE 339 CVC)
%%+ (PANTONE 653 CVC)
For example, some AI files have %%DocumentCustomColors which shows a list of the Pantone color values. However, other files don't contain that at all and have variably things like "%%CMYKProcessColors" which contains the Pantone values. Sometimes there are Pantone values listed that are not included in the image but show up in the Swatches and we don't know how to tell the difference. It sort of feels like we're trying to hit a moving target.
So is there a way for us to extract the list of Pantone colors from an image and ensure that they are actually used in the image?
