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>
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