Smart Preflight: check colors
Posted: Thu Aug 12, 2021 3:20 pm
Hi all!
I've been playing around with Smart Preflight in PitStop Server and Switch and I came to a little roadblock. I'd like to compare colors of a PDF to the ones in an XML. The XML file is attached as metadata and the color part looks like this:
Now, I'd like to check if any of the Color-elements contain Pantone colors. If wrote an XPath which works when testing in Visual Studio Code but not in Switch. Switch only collects the first element instead of all of them. I think Switch is only ever able to extract a single element from an XML file.
If this worked I would've written it into a PrivateData field, written that content into a variable which I would then exclude from the check during Preflight. I'd also add a boolean to a PrivateData field to tell the Preflight whether to check for Pantone Colors or not.
Does this make any sense? If so: How can I achieve this? If not: What's a way I could try? Any help is much appreciated!
I've been playing around with Smart Preflight in PitStop Server and Switch and I came to a little roadblock. I'd like to compare colors of a PDF to the ones in an XML. The XML file is attached as metadata and the color part looks like this:
Code: Select all
<Order>
...other stuff
<Colors>
<FrontColors>
<Color>Key</Color>
<Color>Cyan</Color>
<Color>Magenta</Color>
<Color>Yellow</Color>
</FrontColors>
<BackColors>
<Color>Key</Color>
<Color>Cyan</Color>
<Color>Magenta</Color>
<Color>Yellow</Color>
</BackColors>
</Colors>
</Order>
Code: Select all
//FrontColors/*[not(self::Color='Key' or self::Color='Cyan' or self::Color='Yellow' or self::Color='Magenta')]
If this worked I would've written it into a PrivateData field, written that content into a variable which I would then exclude from the check during Preflight. I'd also add a boolean to a PrivateData field to tell the Preflight whether to check for Pantone Colors or not.
Does this make any sense? If so: How can I achieve this? If not: What's a way I could try? Any help is much appreciated!