I have EPSON thermal printer, model TM-88IV. I am able to get the various properties of the printer but cannot find any to get the following status:
- Paper is out
- Printer is in error state
- Printer is off
I am using the following code:
string printerName = "EPSON";
string query = string.Format("SELECT * from Win32_Printer WHERE Name LIKE '%{0}%'", printerName);
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
ManagementObjectCollection coll = searcher.Get();
foreach (ManagementObject printer in coll)
{
MessageBox.Show(printer.Properties["Name"].Name + " - " + printer.Properties["Name"].Value
+ "\n" +
printer.Properties["PrinterStatus"].Name + " - " + printer.Properties["PrinterStatus"].Value
+ "\n" +
printer.Properties["DetectedErrorState"].Name + " - " + printer.Properties["DetectedErrorState"].Value
+ "\n" +
printer.Properties["ExtendedDetectedErrorState"].Name + " - " + printer.Properties["ExtendedDetectedErrorState"].Value
+ "\n" +
printer.Properties["ExtendedPrinterStatus"].Name + " - " + printer.Properties["ExtendedPrinterStatus"].Value
);
}
I am getting various values for the above properties but cannot map it to the status of the printer.
The output is
Name: EPSON TM-T88IV
PrinterStatus : 3
DetectedErrorState: 0
ExtendedDetectedErrorState: 0
ExtendedPrinterStatus: 2
I have installed the EPSON TM-88IV drivers that came in the cd along with the printer.