Hello
I'm try to build a flow to filter PDFs with the same number of spot colours in to the same folder.
ie: 2 spot PDFs go in to Folder1 or 3 spot PDFs go in to Folder2.
[Stats.Colorants] can add Pantone colours to the file name (OriginalName_All;GOLD FOIL;PANTONE 282 C;PANTONE 872 C.pdf) but don't know how to count occurrences of the word 'Pantone' the file name to filter the PDFs to different folders - if indeed that is the correct way of doing it?
Would also like to filter based on how many process colours are used, but not sure if that is possible?
Any suggestions would be greatly appreciated.
Richard
Filter jobs based on number of colours in PDF
-
- Newbie
- Posts: 2
- Joined: Tue Jul 21, 2015 2:58 pm
Re: Filter jobs based on number of colours in PDF
Counting the number of times the word "PANTONE" is present in the [Stats.Colorants] variable is the easiest with a script expression:
Use this script expression on something like "Attach job state" to store the value there so you can build a condition that compares [Job.JobState] with some value.
Filtering on process colors being used requires something more, because checking color spaces and the like will not do. The only reliable method is to run a PitStop preflight profile that includes "Ink info" in the report (check the box in the General tab of the profile). It does not have to perform any checks, so it can be empty apart from the ink info. Make sure the report is XML and that it is attached as a dataset. Then you can use XPath expressions to pick the information from the XML report to draw accurate conclusions. Here is an XPath that returns 0 or 1 depending on whether there is cyan in the job or not:
Code: Select all
var colorants = job.getVariableAsString("[Stats.Colorants]").split(";");
var pantones = 0;
for (var i=0; i<colorants.length; i++) {
if (colorants[i].find("PANTONE") !== -1) {
pantones = pantones+1;
}
}
pantones;
Filtering on process colors being used requires something more, because checking color spaces and the like will not do. The only reliable method is to run a PitStop preflight profile that includes "Ink info" in the report (check the box in the General tab of the profile). It does not have to perform any checks, so it can be empty apart from the ink info. Make sure the report is XML and that it is attached as a dataset. Then you can use XPath expressions to pick the information from the XML report to draw accurate conclusions. Here is an XPath that returns 0 or 1 depending on whether there is cyan in the job or not:
Code: Select all
count(//Instance[Var/@name='Coverage' and Location/@page=-1]/Var/Var/Var[@name='Cyan'])
-
- Newbie
- Posts: 2
- Joined: Tue Jul 21, 2015 2:58 pm
Re: Filter jobs based on number of colours in PDF
Hello Freddy
Thank you for your reply, have already got the Pantone count working which is of great help.
Will look further in to your process colours script solution tomorrow. Although the initial report I ran only showed percentage ink coverage rather than what process colour was being used.
Will let you know how I get on.
Regards
Richard
Thank you for your reply, have already got the Pantone count working which is of great help.
Will look further in to your process colours script solution tomorrow. Although the initial report I ran only showed percentage ink coverage rather than what process colour was being used.
Will let you know how I get on.
Regards
Richard