ZSDK_API  1.4.957
 All Classes Functions Enumerations Enumerator Properties Pages
ZebraPrinterFactory Class Reference

A factory used to acquire an instance of a ZebraPrinter. More...

#import <ZebraPrinterFactory.h>

Inheritance diagram for ZebraPrinterFactory:

Class Methods

(id< ZebraPrinter, NSObject >) + getInstance:error:
 Factory method to create the correct ZebraPrinter concrete class based on the printer's control language.
 
(id< ZebraPrinter, NSObject >) + getInstance:withCpclPrefixes:error:
 Factory method to create the correct ZebraPrinter concrete class given a user supplied list of known CPCL prefixes.
 
(id< ZebraPrinter, NSObject >) + getInstance:withPrinterLanguage:
 Factory method to create the correct ZebraPrinter concrete class based on the provided printer control language.
 

Detailed Description

A factory used to acquire an instance of a ZebraPrinter.

Method Documentation

+ (id<ZebraPrinter,NSObject>) getInstance: (id< ZebraPrinterConnection, NSObject >)  connection
error: (NSError **)  error 

Factory method to create the correct ZebraPrinter concrete class based on the printer's control language.

If the SGD value, appl.name, starts with one of the following, the printer is determined to be a CPCL printer. Otherwise it is considered to be a ZPL printer

  • SH
  • H8
  • C


If you wish to use prefixes other than the ones listed above, use getInstance:withCpclPrefixes:error:

Note : iMZ printers are configured by default to be in "Line Print" mode. This method will put the printer ZPL mode so that the operations on a ZebraPrinter object will work. To put the printer back in Line Print mode, set the SGD "device.languages" to "line_print" (! U1 setvar "device.languages" "line_print")

Parameters
connectionAn open connection to a printer.
errorWill be set to the error that occured. error.code will be ZEBRA_ERROR_NO_CONNECTION if the connection was not open. error.code will be ZEBRA_UNKNOWN_PRINTER_LANGUAGE if the appl.name SGD value could not be obtained from the printer.
Returns
An instance of a ZebraPrinter.
+ (id<ZebraPrinter,NSObject>) getInstance: (id< ZebraPrinterConnection, NSObject >)  connection
withCpclPrefixes: (NSArray *)  cpclPrefixes
error: (NSError **)  error 

Factory method to create the correct ZebraPrinter concrete class given a user supplied list of known CPCL prefixes.

If the SGD value, appl.name, starts with one of the cpclPrefixes, the printer is determined to be a CPCL printer. Otherwise it is considered to be a ZPL printer

Note : iMZ printers are configured by default to be in "Line Print" mode. This method will put the printer ZPL mode so that the operations on a ZebraPrinter object will work. To put the printer back in Line Print mode, set the SGD "device.languages" to "line_print" (! U1 setvar "device.languages" "line_print")

Parameters
connectionAn open connection to a printer.
cpclPrefixesAn array of possible CPCL version number prefixes.
errorWill be set to the error that occured. error.code will be ZEBRA_ERROR_NO_CONNECTION if the connection was not open. error.code will be ZEBRA_UNKNOWN_PRINTER_LANGUAGE if the appl.name SGD value could not be obtained from the printer.
Returns
An instance of a ZebraPrinter.
+ (id<ZebraPrinter,NSObject>) getInstance: (id< ZebraPrinterConnection, NSObject >)  connection
withPrinterLanguage: (PrinterLanguage)  language 

Factory method to create the correct ZebraPrinter concrete class based on the provided printer control language.

Parameters
connectionAn open connection to a printer.
languageThe language of the printer instance to be created.
Returns
An instance of a ZebraPrinter.

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