How to be sure a print job is finished? (1 Viewer)

KitaYama

Well-known member
Local time
Today, 23:03
Joined
Jan 6, 2022
Messages
1,541
We receive orders for up to 10 years later. The orders come in through an on-line system, are saved as PDF files, and registered in the database. But won't be printed.

There's a weekly schedule to print the orders up to 3 months later. FE opens a recordset of the orders, loops through it and prints:
1- A report that contains all the necessary processes and steps for manufacturing the part,
2- The order sheet (saved pdf file)
3- And then the drawings.

Let's say the record count is 300. We expect to have 300 sets of 3 layer of papers: 1)Printed report (Access report), 2)Order sheet(Pdf) 3)its drawing(PDF).
But it will never happen this way. VBA is running too fast. Windows and printer are left behind. The printed result is a mess and mixed. We have to waste a lot of time to separate the mixed pile of papers. VBA loops through the recordset and sends the print job one after the other, but windows has to open the pdf files, print it and close it. It takes a while and VBA is sending the jobs continuously. Printer's queue list is filled and to our surprise, Windows or Printer doesn't print jobs with the order they've been added. It seems that printer picks the pending job randomly.

now my questions:
1- Is there any way to recognize if a print job is finished or not to send the next job? We need to keep the order of printed documents just the same as the recordset we've opened.
Our printers are capable of printing 40 pages per minute. We thought of adding a sleep time after sending each print job, but the result was not enough.

2-Is there any way to force Windows or Printer , print jobs in the order they've been added to the print queue?

Any other idea to sort this problem is much appreciated.
thanks.
 
Last edited:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 09:03
Joined
Feb 28, 2001
Messages
27,187
This link seems to be relevant:


The problem is that you must interact with the properties of the print queue to force job order, and I believe that you can only put a one-byte print priority on any job. Therefore, no more than 255 jobs can be waiting. Jobs CAN be multi-file, each file in the same job having the same print priority, if you wanted to keep files grouped together.

You would also have to check whether your print queue was defined with any of the typical "Queuing Theory" optimizations. For example, the way to empty a print queue the fastest is "SPT" (Shortest Processing Time) first. It is provable within Queuing Theory that for a single printer, you print the most jobs in the shortest time if you print the shortest jobs first. While I can't swear to this, I believe "Shortest Processing Time" relies on "Smallest File" as the estimator for shortest processing time. If the printer queue has been defined to use SPT optimization, you could have a hard time turning it off.

Another factor that can be difficult is that if the printer is a wireless printer, your command to print a file is busy only until the first part of the file has filled up the printer's memory buffers. If there is more than one system feeding files to your printer via Wi-Fi, you will have the devil of a time trying to control which file gets printed next, because the only entity that can control anything is the printer itself - and it isn't that easy to program.

I know this kind of question has been asked before, but the difficulty is that the Access job would have to make some kind of network call to the printer to determine whether it was active or not. I don't recall that anyone has a clear solution.

Here is a thread that has some useful links in it.

 

KitaYama

Well-known member
Local time
Today, 23:03
Joined
Jan 6, 2022
Messages
1,541
@The_Doc_Man thanks for the info.
I will go through the shared links to see what can I do with our situation.

For now the only thing that I can say for sure is that the Printers are all Wired and have static IPs on Active directory.

Once again thanks.
 

Users who are viewing this thread

Top Bottom