Question How to stop a direct print job to an offline printer hanging forever

memphisjames

New Member
I'm curious if anyone here knows how to test for a Windows printer being online before sending a print job to a printer that is offline. I have the printer defined in windows and set as print directly (not spooling), connected locally using USB with the default Zebra print driver, using passthrough printing (-Wa -wpp). This works great when the printer is on and connected, but sometimes the cables get unplugged or damaged. Output to printer doesn't fail. As soon as the program prints a label and the printer is offline, the program hangs forever until it is killed with task manager. I can't put a timeout or no-error on the output to printer statement, and Progress never returns an error I can trap. If I use the windows spooling option, I get jobs in the printer queue that never print. Does anyone have a workaround for this?

Thanks
 
Top