Hi all
I have an issue where I have a large PDF that contains records with a variable number of pages (around 2200 pages in total). It is always an even number as we have to print duplex, so 2 pages for record 1, 6 pages for record 2, 4 pages for record 3 and so on. The requirement is to print an incremental sequenced barcode on each record set on the odd numbered pages per record. No problem, except that for what ever reason it takes many, many hours to process, time we don’t have.
The workaround for this issue is as below, thanks to hamelj, taken from another post:
"If the incoming file is very big, you could use the “stamping method” which consists 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 stamp (merge one PDF on the other) to the original one.
Set MyOriginalPDF = Watch.GetPDFEditObject
MyOriginalPDF.Open Watch.GetJobFileName, False
MyOriginalPDF.MergeWith "My_Barcoded_Document.pdf"
MyOriginalPDF.Save False
All good there, except that because I’m using the input PDF as the data but not the background, the output PDF only creates 2 pages per record (as it is set to duplex). Therefore I’m left with an output PDF that is less pages than the original input PDF and thus cannot use the stamping method to overlay the original without some additional scripting.
Apparently this could possibly be done using some other functions below, however I’m a novice when it comes to scripting so if anyone has any code that could help it would be much appreciated
The function to use would be Merge2 (to stamp the new PDF pages on the original one) with a combination of InsertFrom2 (to insert the blank page from the new PDF into the original one). The definition of these functions can be found in the Alambic API.