Printer
|
The PrinterStatusMessages type exposes the following members.
| Name | Description | |
|---|---|---|
| PrinterStatusMessages | Used to acquire a human readable string of the current errors/warnings stored in printerStatus |
| Name | Description | |
|---|---|---|
| Equals | (Inherited from Object) | |
| GetHashCode | (Inherited from Object) | |
| GetStatusMessage | Used to acquire a human readable string of the current errors/warnings passed to this instance. | |
| GetType | (Inherited from Object) | |
| ToString | (Inherited from Object) |
| Name | Description | |
|---|---|---|
| HEAD_OPEN_MSG | Message to indicate the head is open. | |
| HEAD_TOO_HOT_MSG | Message to indicate the head is too hot. | |
| NULL_MSG | Message to indicate printerStatus is null. | |
| PAPER_OUT_MSG | Message to indicate the paper is out. | |
| PAUSE_MSG | Message to indicate printer is paused. | |
| RECEIVE_BUFFER_FULL_MSG | Message to indicate the receive buffer is full. | |
| RIBBON_OUT_MSG | Message to indicate the ribbon is out. |
using System; using Zebra.Sdk.Comm; using Zebra.Sdk.Printer; public class PrinterStatusMessagesExample { public static void Main(string[] args) { Connection connection = new TcpConnection("192.168.1.100", TcpConnection.DEFAULT_ZPL_TCP_PORT); try { connection.Open(); ZebraPrinter printer = ZebraPrinterFactory.GetInstance(connection); PrinterStatus printerStatus = printer.GetCurrentStatus(); if (printerStatus.isReadyToPrint) { Console.WriteLine("Ready To Print"); } else { PrinterStatusMessages statusMessage = new PrinterStatusMessages(printerStatus); string[] statusMessages = statusMessage.GetStatusMessage(); string joinedStatusMessage = ""; for (int i = 0; i < statusMessages.Length; i++) { joinedStatusMessage += statusMessages[i] + ";"; } Console.WriteLine($"Cannot Print: {joinedStatusMessage}"); } } catch (ConnectionException e) { Console.WriteLine(e.ToString()); } catch (ZebraPrinterLanguageUnknownException e) { Console.WriteLine(e.ToString()); } finally { connection.Close(); } } }