Reputation: 11
I need to programmatically find out whether or not a PDF contains a pantone color, but I'm not sure what exactly to look for. My idea of achieving this would be to iterate through all of the PDF's information and to look for certain RGB or CMYK values.
Where and how are these values saved? Am I misunderstanding some concepts here perhaps?
Upvotes: 1
Views: 1115
Reputation: 625
The base case for specifying a Pantone Color is via a separation Colour space (see section 8.6.6.4 of the PDF 32000-1:2008 specification). The colorant name itself is the only indicator of the ink being a Pantone colorant.
However, it is also possible/likely that separation colour spaces may not be specified by themselves but within DeviceN colour Spaces (see section 8.6.6.5) or as the base colour space for Pattern Colour Spaces, either Shading Patterns (see section 8.7.4) or coloured tiling patterns (see section 8.7.3.2).
To find these colour spaces, you would look in each page's (optional) Resource dictionary (see section 7.8.3) for ColorSpace entries, shading entries, or XObject entries. The latter to recursively look for Form XObjects entries that may have their own ColorSpace/Shading/XObject entries.
Upvotes: 2