Copy job & move to new queue

Feb 10, 2009 at 7:06 PM

Hi - I'm struggling to understand the best way to achieve this, can someone please point me in the right direction.

My users are printing to shared network printers on a windows server.  When the name of the document being printed matches the name I've specified - I'd like to take a copy of the print job & place it into a different queue.  This 2nd queue is for an automated PDF Creation tool & shall turn the document into a PDF & store it away.  I would like the original job to contiue printing on the original queue.

I am using VB .NET 2.0 & the PrinterQueueWatch dll.  I can perform most of the tasks I need to do, such as identify the document name when it enters the queue- but I'm failing to see how to copy the original print job to another queue & then allow the origiinal job to continue.

Can someone please show me a little code to achieve this.  Also - is there any advice to make this process a little more 'robust', such as wait for the 'SPOOLING FINISHED' notification before copying?

Thank you in advance,

Paul Adams
Feb 10, 2009 at 7:16 PM
I'm afraid I don't know very much that can help, but I can say you should wait for a "SPOOLING FINISHED" notification before copying the spool file.
You can do this by monitoring JOB_WRITTEN events and checking the PrintJob.Spooled property..
Feb 10, 2009 at 7:42 PM

Thank you for the fast reply - I'm now checking PrintJob.Spooling property and waiting for it to change to FALSE.

Is there a reference to the spool file name & location to make sure I'm copying the correct one?
Sep 15, 2009 at 4:36 AM

I was looking to achieve the same thing. What I ended up doing was creating a queue that will print to a ps file first using a virtual printer - Redmon, or mfilemon. Then using the jobdeleted event on the virtual printer to reprint the job to the actual printer.

Sep 15, 2009 at 6:38 PM

Yes - I did something very similar.  I created virtual redirected printer (using Redmon EE) but used the 'temp file to printer' option to send the original job on to the printer once my EXE I'd specified in the REDMON parameters had finished running.

Then I created a VB 2008 EXE that received the options sent from REDMON EE - and it copies the temp PS file to a second location (for later processing into a PDF) - and then finishes - which in turn causes the print job to continue to the proper real printer.

Same as your's really - except you copy the file to the printer.

I'll have to look at mfilemon - never heard of it.


Paul Adams

Apr 6, 2010 at 6:29 AM
Edited Apr 23, 2010 at 1:48 AM

Thanks, it was helpful. I also had such a problem.