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: 2.13.898
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
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetStatusMessage
Used to acquire a human readable string of the current errors/warnings passed to this instance.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(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
Examples
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