PrinterStatus Class |
Namespace: Zebra.Sdk.Printer
The PrinterStatus type exposes the following members.
Name | Description | |
---|---|---|
PrinterStatus |
Constructs a PrinterStatus instance that can be used to determine the status of a printer.
|
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
isHeadCold | true if the head is cold. For CPCL printers this is always false | |
isHeadOpen | true if the head is open.
| |
isHeadTooHot | true if the head is too hot. For CPCL printers this is always false | |
isPaperOut | true if the paper is out.
| |
isPartialFormatInProgress | true if there is a partial format in progress. For CPCL printers this is always false.
| |
isPaused | true if the printer is paused. For CPCL printers this is always false | |
isReadyToPrint | true if the printer reports back that it is ready to print
| |
isReceiveBufferFull | true if the receive buffer is full. For CPCL printers this is always false | |
isRibbonOut | true if the ribbon is out.
| |
labelLengthInDots |
The length of the label in dots. For CPCL printers this is always 0.
| |
labelsRemainingInBatch |
The number of labels remaining in the batch. For CPCL printers this is always 0.
| |
numberOfFormatsInReceiveBuffer |
The number of formats currently in the receive buffer of the printer. For CPCL printers this is always 0.
| |
printMode |
The print mode. For CPCL printers this is always UNKNOWN |
using System; using Zebra.Sdk.Comm; using Zebra.Sdk.Printer; public class PrinterStatusExample { 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 if (printerStatus.isPaused) { Console.WriteLine("Cannot Print because the printer is paused."); } else if (printerStatus.isHeadOpen) { Console.WriteLine("Cannot Print because the printer head is open."); } else if (printerStatus.isPaperOut) { Console.WriteLine("Cannot Print because the paper is out."); } else { Console.WriteLine("Cannot Print."); } } catch (ConnectionException e) { Console.WriteLine(e.ToString()); } catch (ZebraPrinterLanguageUnknownException e) { Console.WriteLine(e.ToString()); } finally { connection.Close(); } } }