Hi all,
I have PDFs of invoices with barcoded invoice# and QR for customer account#. The batch could include a delivery document that needs to stay attached to the invoice that preceded it in the batch.
I’ve read other posts about this and as much as I hammer at it, I cannot figure this out. I can get the PDFs to split but not attach the misc documents in between. Also, the PDFs I’m getting at the moment are trashed/empty as a “cannot open file” error is happening.
This is my process:
Folder capture - *.pdf
Create Metadata - passthrough
Barcode scan - detect QR and Code39. Process by file & delete existing metadata
PDF Splitter based on metadata, Metadata level: data page, Sequencing is based on: The following rule: (GetMeta(BarcodeValue[0], 10, Job.Group[0].Document[0].Datapage[0]) Value changed ))
Send to Folder - path=c:\archive%{QRAccount} filename:%{BarcodeInvoice}.pdf - concatenate files.
This can’t work. The Barcode scan identifies each new document based on a barcode. But there is no way to tell it that “maybe there’s a delivery document before this one, maybe not”. So the delivery document is likely to be added to the previous invoice, which would be disastrous!
You’ll have to use a script for this. The barcode scan can still be used, but then you’ll have to loop through the metadata and inspect each document to check if there is a delivery document before it, then concatenate the pages of that delivery document to the invoice if applicable.
This isn’t a simple project. I would probably change the approach:
First, use a script to remove all delivery documents from the batch (assuming they are relatively easy to identify). Each Delivery document would then be stored in a temporary folder, with their names being set to the Invoice number to which they are attached.
Then, use the barcode scan to split your batch. Since there are no delivery documents remaining, this will give you a batch of separate invoices.
Finally, for each invoice number, check if there exists a corresponding delivery document in the temporary folder and if so, concatenate it to the invoice.
Hi Phil, thanks for the info. My PPress scripting skills are not good. Could you point me to a script that will do this, or close enough that I could rework it?
That is too specific of a use case for me to have a script that could serve as a basis for your project.
Unless some other member of this community can help, you should probably contact your reseller to ask if they can provide the professional services for implementing the script.
Thanks, Phil,
I got it to work without a script using a 2nd set of variables to carry the customer# and invoice# over to the next file. See below.
Thanks,
Tom
Folder capture - *.pdf
Create Metadata - passthrough
Barcode scan - detect QR and Code39. Process by file & delete existing metadata
PDF Splitter based on metadata, Metadata level: Data page, Sequencing is based on: The following rule:(Barcode_1_Value Value changed ). Not Optimizing or Resetting Metadata.