3

I'm fairly new to printing in C# and am trying to find the current status of a specific printer (if it's offline, if it's out of paper, etc) before printing.

LocalPrintServer server = new LocalPrintServer();
PrintQueue printQueue = server.GetPrintQueue("EPSON WF-2540 Series");
MessageBox.Show(printQueue.IsOffline.ToString());

The code does seem to successfully find the specified printer but always sees it as online. It doesn't matter if the printer is turned on, turned off, or even unplugged (I use a direct usb connection). Does anybody have any ideas as to what can be causing this? Thank you in advance I greatly appreciate it!

ZoomVirus
  • 615
  • 7
  • 22
Roger
  • 97
  • 2
  • 7

1 Answers1

8

From MSDN documentation on PrintQueue.IsOffline member (remarks section):

If the printer does not support a signal with this meaning, then the property is always false.

apparently, it is your case and this property is never set to True.

Crypt32
  • 12,850
  • 2
  • 41
  • 70
  • Even if printer doesn't support mentioned signal, somehow, control panel printer and devices manage to show the printer is offline! – AaA Aug 15 '18 at 03:53