OnJobSpoolfileParsedEvent

Developer
Apr 26, 2015 at 12:10 PM
Duncan,

Can you confirm the routine OnJobSpoolfileParsedEvent in the PrintMonitorService project actually gets invoked from PrintQueueWatch?

Also i'm finding that some print jobs are spooled and then left paused so the user do not get their print outs.

So i'm wondering if i'll need to write another app to monitor printers and compare against the database for resuming the print or perhaps make another thread running from within the PrintMonitorService to do the releasing?

Perhaps that would be a good thing to write anyway the service starting another thread to release any hung jobs? Could you provide some help on the code needed to check/release hung jobs?

Thanks
Martin
Developer
Aug 12, 2015 at 8:39 AM
Edited Aug 12, 2015 at 9:40 AM
Duncan,

I'm still getting some print jobs paused and not released, is there an easy way to check the jobs per printer to compare against the table records to identify any stalled jobs to then release somehow.

The service project reacts to the watch component for events firing for current jobs but is there any way to get it to remonitor the print queue for stalled jobs?

Any advice is appreciated as I can't fathom the exact reason for these stalled jobs, no trend just random!

BTW i have some old VB6 code of yours that uses a Dll project called EventVB that stops/resume print jobs but i thought it would be better for theVb.Net service to manage stalled jobs instead of using InterOp to Vb6.

Regards
Martin
Coordinator
Aug 13, 2015 at 8:05 AM
Definitely it is better to use the .NET service than the VB6 version - not least because I no longer have the source code for the EventVB.dll - the API calls they both use are the same though.

You can enumerate all the current print jobs on a printer - use the PrinterInformation.PrintJobs collection ( See https://printqueuewatch.codeplex.com/wikipage?title=PrinterInformation&referringTitle=Class%20library )

Print jobs have an unique id number - but this resets every time the operating system is rebooted so if you are storing it in a database you need a compound key with a "restart counter".

Also - maybe email me some source code in case there's something I can see causing the random stalled jobs?