6

I am trying to get the printer status of a PointOfSale printer using the following code:

Hashtable properties = new Hashtable();
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win2_Printer");

foreach (ManagementObject obj in searcher.Get()) {
  if (obj["name"].ToString() == printerName) {
    foreach (PropertyData data in obj.Properties) {
      if(data.Name.ToLower() = "printerstatus") {
        int printerStatus = Convert.ToInt32(data.Value);
      }
    }
  }
}

Problem is, the status is either 3 (idle) or 4(printing), even when unplugged or the paper is out.

I have read a lot of posts with this same issue, but have not found an answer. Is this correct? How else would I check the status? Any help is appreciated.

1 Answers1

0

What Brand of printer are you using?

Sometimes the Brand will have a specific command you can send to query the status.

CommonSense
  • 341
  • 1
  • 6
  • I would say keep researching it. This page http://www.custom.it/eng/products/show_product.aspx?id=KioskEquipment&pid=47 indicates they have a status dll. You'll need to find some documentation for it. – CommonSense Sep 06 '11 at 20:58
  • Ya, I found that link. I emailed tech support and received a response in, I think, Italian. Thanks for the effort, tho! – PrinterNoWorky Sep 06 '11 at 21:27