I have a project where I send a group of individual .PRN files (1 per product type purchased per invoice) to a printer and separate each PRN with a 1 page Customer/Product List for that invoice.
The PRN files are PDFs were created for each product type, and then set up to print a specific way (Binding, Folding, Stapling) and then 'Print to File'. We did this because much of the printer 'Finishing' features are not able to be controlled programmaticly.
To print them I use 'Run Copy filename.prn /B \\Server\Printer'
The separator page is a VFP Report.
The problem I'm experiencing is that the Run Copy... sometimes gets to the printer faster than the Report Form ... to Printer, and I can't guarantee that these individual print jobs will print in the exact order that I'm sending them, which is a job requirement.
I'm starting to look now at 'Enumerating jobs in a print queue' from
http://www.berezniker.com (Thanks again Sergey) to see if I can use it to monitor printed jobs, not just what is currently in the queue.
I'd also like to find an API for copying the PRN file. The Run Copy.. command fires and immediately moves on to the next line of code (right?). I'd like to use something that doesn't allow the program to continue until the copy has actually completed.
By the way, I can run this by inserting managed pauses in the programs after each print job, but I don't like that approach. No matter how long a pause is required for this to work today, eventually that won't be long enough, or will break somehow.
Thanks for any help