Depending on how the PDF is you could use the PDF as input data in the data mapper. Then define its delimiter on a word that is only on the first page of each record. That would split the PDF’s into variable page records. (this way you would not need Workflow to split them.) Then create a field by adding a extract field in the steps pane. Change the field name to say … SeqNum and set its type to javascript. In the javascript section of that variable you type record.index; That will create a self incrementing sequence number.
In your print template you would set the sections background to PDF from data mapper. And set its page range to All and position to Absolute. From there just add the sequence number to the first page. Then in Workflow you would just use a all in one to output the final PDF. As far as OMR is concerned I have yet to look at that but if yours is working for the specific inserting machine you would add them by using either a job preset or output preset. I cant remember which.
You need to create a form In PlanetPress that takes PDFs as its input data and background. Then, based on the content on the PDF you create your OMR, and any other change you want to add to the PDF. The you can output a new PDF or print it the usual way.
Optimisation: you already split your PDFs before needing to add the OMR and others therefore I assume the resulting PDFs aren’t very big as far as file size. However, if you ever see that it takes too long to process, you could consider the following:
1- The incoming original PDF (before splitting) could be the one used in PlanetPress to add your OMR and others.
2- If that incoming file is very big, you could use the “stamping method” which consist of having your PDF as the data but not the background. The resulting new PDF (out of PlanetPress) would be the same amount of pages as the original but with only your OMR code and other changes on empty sheets. Then using a script, you actually stamps (merge one PDF on the other) to the original one.
3- You split your PDF into multiple one using the PDF splitter.
All of this of course is if you have performance issue.
“2- If that incoming file is very big, you could use the “stamping method” which consist of having your PDF as the data but not the background. The resulting new PDF (out of PlanetPress) would be the same amount of pages as the original but with only your OMR code and other changes on empty sheets. Then using a script, you actually stamps (merge one PDF on the other) to the original one.”
Thanks, I have this working to a point. For clarification, I have no need to split the output.
My input PDF has records with odd and even pages, the output file I create with the barcode is duplex, so a blank page is added for the odd page records. So the problem now is the input PDF and output PDF are no longer the same number of pages and as such there is a mismatch when overlaying.
Can you give any advice on how I would go about correcting this?
Then you will need to resort to more scripting. The function to use would be Merge2 (to stamp the new PDF pages on the original one) with a combination of InserFrom2 (to insert the blank page from the new PDF into the original one). The definition of these function can be found in the Alambic API. Unfortunately, I do not have an example to provide you.