Click or drag to resize

PrinterStatus Class

A class used to obtain the status of a Zebra printer.
Inheritance Hierarchy
SystemObject
  Zebra.Sdk.PrinterPrinterStatus

Namespace: Zebra.Sdk.Printer
Assembly: SdkApi.Core (in SdkApi.Core.dll) Version: 3.0.3271
Syntax
public abstract class PrinterStatus

The PrinterStatus type exposes the following members.

Constructors
 NameDescription
Public methodPrinterStatus Constructs a PrinterStatus instance that can be used to determine the status of a printer.
Top
Methods
 NameDescription
Public methodEquals
(Inherited from Object)
Public methodGetHashCode
(Inherited from Object)
Public methodGetType
(Inherited from Object)
Public methodToString
(Inherited from Object)
Top
Fields
 NameDescription
Public fieldisHeadColdtrue if the head is cold. For CPCL printers this is always false
Public fieldisHeadOpentrue if the head is open.
Public fieldisHeadTooHottrue if the head is too hot. For CPCL printers this is always false
Public fieldisPaperOuttrue if the paper is out.
Public fieldisPartialFormatInProgresstrue if there is a partial format in progress. For CPCL printers this is always false.
Public fieldisPausedtrue if the printer is paused. For CPCL printers this is always false
Public fieldisReadyToPrinttrue if the printer reports back that it is ready to print
Public fieldisReceiveBufferFulltrue if the receive buffer is full. For CPCL printers this is always false
Public fieldisRibbonOuttrue if the ribbon is out.
Public fieldlabelLengthInDots The length of the label in dots. For CPCL printers this is always 0.
Public fieldlabelsRemainingInBatch The number of labels remaining in the batch. For CPCL printers this is always 0.
Public fieldnumberOfFormatsInReceiveBuffer The number of formats currently in the receive buffer of the printer. For CPCL printers this is always 0.
Public fieldprintMode The print mode. For CPCL printers this is always UNKNOWN
Top
Example
C#
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();
        }
    }
}
See Also