Page 1 of 1

Creating variables from Pitstop report xml

Posted: Tue Sep 23, 2025 5:14 pm
by PrepressUnc
I'm trying to build a flow that sorts a 2 page pdf so the page with less ink coverage is ordered first. I have a preflight check with pitstop server configured to output job data with an xml log. I assume I just need to map this snippet of xml to variables (Page 1 ink percentage = 143.01, Page 2 Ink percentage = 57.03) so I can configure a routing connection. How can I go about doing this?

Re: Creating variables from Pitstop report xml

Posted: Wed Sep 24, 2025 2:47 pm
by magnussandstrom
I can think of a couple of ways to do this. Do you have the scripting module for Switch?

Re: Creating variables from Pitstop report xml

Posted: Wed Sep 24, 2025 9:15 pm
by PrepressUnc
Yes, I do have a trial of the scripting module

Re: Creating variables from Pitstop report xml

Posted: Thu Sep 25, 2025 9:02 pm
by tdeschampsBluewest
Hello,

It may be possible to complete this process without the need for scripting by following these steps:
  1. Split the PDF
  2. Ungroup the job
  3. Run a preflight check to obtain ink coverage data
  4. Rename the job, using the ink coverage value as a prefix
  5. Add leading zeros to ensure consistent digit length across all filenames
  6. Reassemble the ungrouped job
  7. Merge the files
That should do the trick :)

Re: Creating variables from Pitstop report xml

Posted: Fri Sep 26, 2025 1:13 pm
by magnussandstrom
I was thinking of the same solution, but how would you add leading zeros when one file is names 57 and another 158 (to get 0057 and 0158)?

Re: Creating variables from Pitstop report xml

Posted: Fri Sep 26, 2025 9:05 pm
by tdeschampsBluewest
Using the latest versions of the Rename Job tool there's a handy new action called "Add Leading Zeros".

To make it work, you'll need to add a regular expression to find the number you want to pad in your filenames.

Example filenames:

Code: Select all

123456_toto_35.pdf
123456_tata_8.pdf
Use this regex to target the number before the `.pdf` extension:

Code: Select all

\d+(?=\.pdf)
This feature wasn’t heavily advertised, but it’s super useful when dealing with numbers.