Batch printing application looses document order

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm writing an application in vb.net 2005 to batch-print several .pdf file
to the default printer, using Process.Start method, without multithreading.

But the order of the documents queued in the printer is not correct and
every time different. For example, if the application prints, in order
1.pdf
2.pdf
3.pdf
in the printer queue I find
3.pdf
1.pdf
2.pdf
or
2.pdf
1.pdf
3.pdf
....

How to be sure to keep the right order?

Thanks.
 
Perhaps the process you are starting is contrubuting to this, by doing it's
own forwarding and threading...

Anyways, one approach would be to stitch the pdfs into one before printing
(the first google I found was PDFtoolkit (by gnostice), but bound to be
others) - but this might take a lot of space / memory. Also perhaps look at
what is actually doing the printing; is this your code? Perhaps another
product might offer synchronous printing? (looks like PDFtoolkit also does
printing - no idea whether it is any good)

That's my £0.02, anyways,

Marc
 
Wait for process exit on each process at the bottom of the loop. It is
using multi-threading as your using multiple processes - so the last
document you start could be finished before the first document.

--
William Stacey [MVP]

message | Hi,
|
| I'm writing an application in vb.net 2005 to batch-print several .pdf file
| to the default printer, using Process.Start method, without
multithreading.
|
| But the order of the documents queued in the printer is not correct and
| every time different. For example, if the application prints, in order
| 1.pdf
| 2.pdf
| 3.pdf
| in the printer queue I find
| 3.pdf
| 1.pdf
| 2.pdf
| or
| 2.pdf
| 1.pdf
| 3.pdf
| ...
|
| How to be sure to keep the right order?
|
| Thanks.
|
 
Back
Top