Click or drag to resize

PrinterStatusMessages Class

This class is used to acquire a human readable string of the current errors/warnings stored in a PrinterStatus instance.
Inheritance Hierarchy
SystemObject
  Zebra.Sdk.PrinterPrinterStatusMessages

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

The PrinterStatusMessages type exposes the following members.

Constructors
 NameDescription
Public methodPrinterStatusMessages Used to acquire a human readable string of the current errors/warnings stored in printerStatus
Top
Methods
 NameDescription
Public methodEquals
(Inherited from Object)
Public methodGetHashCode
(Inherited from Object)
Public methodGetStatusMessage Used to acquire a human readable string of the current errors/warnings passed to this instance.
Public methodGetType
(Inherited from Object)
Public methodToString
(Inherited from Object)
Top
Fields
 NameDescription
Public fieldStatic memberHEAD_OPEN_MSG Message to indicate the head is open.
Public fieldStatic memberHEAD_TOO_HOT_MSG Message to indicate the head is too hot.
Public fieldStatic memberNULL_MSG Message to indicate printerStatus is null.
Public fieldStatic memberPAPER_OUT_MSG Message to indicate the paper is out.
Public fieldStatic memberPAUSE_MSG Message to indicate printer is paused.
Public fieldStatic memberRECEIVE_BUFFER_FULL_MSG Message to indicate the receive buffer is full.
Public fieldStatic memberRIBBON_OUT_MSG Message to indicate the ribbon is out.
Top
Example
C#
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();
        }
    }
}
See Also