Generate post-Imposition data file for barcode matching

We are trying to make use of Screen’s perfect track software to confirm sheets are printed correctly front and back. I’m producing barcodes on the sheet for cameras to read and I need to produce a data file to essentially tell the cameras what values to expect.

My input is a standard mail file with records 1-1000, for example. My letters have variable page counts. We also insert QC records during output creation, then we impose these letters 2 up for printing. Once imposed, I have a barcode on the front left, the front right, the back left and the back right. The data file for the perfect track software needs to match the barcodes, which contain sequence number (6 digits), page number currently printing (2 digits) and number of pages in the set (2 digits). For example - let’s say I’m working with 2 sheet letters that print duplex (4 pages total). The output file needs to be:
0000010104,0005010104,0000010204,0005010204
0000010304,0005010304,0000010404,0005010404
0000020104,0005020104,0000020204,0005020204
0000020304,0005020304,0000020404,0005020404

The leading zeros on the sequence number come from the input data file. The page counter and number of pages are generated as additional content as the barcode is created. How can I output the data to a file that matches the barcodes as they are created?

Thanks in advance for any direction.

The Perfect Track software isn’t actually from Screen. It’s software provided with the camera system.

The long way around on this is to also print the barcode output as text and place it in the trim area. I then setup another process to consume the PDF output of our normal printing workflow. That process splits the output PDFs into 2 pages at a time (front and back of 1 sheet). I set 4 local variables to match cameras 1-4 and populate those variables by reading the text from that fixed location on the sheet. I output that to a file setup as needed for the 4 cameras to match. Not as slick as I’d like, but it gets me there.

Well… it gets me there, but slowly. Any ideas on a faster way? I generate the print PDFs in about 3 minutes per file and it takes 12 minutes per file to generate the matching data file.

Ideally, I’d like a way to generate data and write it to a file directly from the information created by my output preset.