Creating variables from Pitstop report xml

Post Reply
PrepressUnc
Newbie
Posts: 6
Joined: Tue Sep 16, 2025 8:10 pm

Creating variables from Pitstop report xml

Post 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?
Attachments
Screenshot 2025-09-23 at 10.05.37 AM.png
Screenshot 2025-09-23 at 10.05.37 AM.png (207.46 KiB) Viewed 902 times
Screenshot 2025-09-23 at 10.05.29 AM.png
Screenshot 2025-09-23 at 10.05.29 AM.png (210.54 KiB) Viewed 902 times
User avatar
magnussandstrom
Advanced member
Posts: 526
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: Creating variables from Pitstop report xml

Post by magnussandstrom »

I can think of a couple of ways to do this. Do you have the scripting module for Switch?
PrepressUnc
Newbie
Posts: 6
Joined: Tue Sep 16, 2025 8:10 pm

Re: Creating variables from Pitstop report xml

Post by PrepressUnc »

Yes, I do have a trial of the scripting module
User avatar
tdeschampsBluewest
Member
Posts: 147
Joined: Tue Jun 01, 2021 11:57 am

Re: Creating variables from Pitstop report xml

Post 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 :)
Do you like the Enfocus Apps developed by Bluewest?
Feel free to leave a comment on the Appstore!
User avatar
magnussandstrom
Advanced member
Posts: 526
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: Creating variables from Pitstop report xml

Post 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)?
User avatar
tdeschampsBluewest
Member
Posts: 147
Joined: Tue Jun 01, 2021 11:57 am

Re: Creating variables from Pitstop report xml

Post 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.
Do you like the Enfocus Apps developed by Bluewest?
Feel free to leave a comment on the Appstore!
Post Reply