Zebra API for iOS (Build v1.6.1158)
Loading...
Searching...
No Matches
PrinterStatus Class Reference

A class used to obtain the status of a Zebra printer. More...

#include <PrinterStatus.h>

Inheritance diagram for PrinterStatus:

Instance Methods

(id) - init
 Initializes a new instance of the PrinterStatus class that can be used to determine the status of a printer.
 

Detailed Description

A class used to obtain the status of a Zebra printer.

Get the current status of a printer.

#import "TcpPrinterConnection.h"
#import "ZebraPrinterFactory.h"
#import "ZebraPrinter.h"
#import "PrinterStatus.h"
#import <UIKit/UIKit.h>
TcpPrinterConnection *zebraPrinterConnection = [[TcpPrinterConnection alloc] initWithAddress:@"192.168.1.100" andWithPort:9100];
BOOL success = [zebraPrinterConnection open];
NSError *error = nil;
id<ZebraPrinter, NSObject> printer = [ZebraPrinterFactory getInstance:zebraPrinterConnection error:&error];
PrinterStatus *printerStatus = [printer getCurrentStatus:&error];
if (printerStatus.isReadyToPrint) {
NSLog(@"Ready To Print");
} else if (printerStatus.isPaused) {
NSLog(@"Cannot Print because the printer is paused.");
} else if (printerStatus.isHeadOpen) {
NSLog(@"Cannot Print because the printer head is open.");
} else if (printerStatus.isPaperOut) {
NSLog(@"Cannot Print because the paper is out.");
} else {
NSLog(@"Cannot Print.");
}
if (error != nil || printer == nil || success == NO) {
UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:@"Error" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[errorAlert show];
[errorAlert release];
}
A class used to obtain the status of a Zebra printer.
Definition PrinterStatus.h:53
Establishes a TCP connection to a printer.
Definition TcpPrinterConnection.h:112
A factory used to acquire an instance of a ZebraPrinter.
Definition ZebraPrinterFactory.h:19

Method Documentation

◆ init

- (id) init

Initializes a new instance of the PrinterStatus class that can be used to determine the status of a printer.


Note: this will only query the printer's status upon creation. If the status needs to be updated see:
getCurrentStatus: (ZebraPrinter-p)


The documentation for this class was generated from the following file: