| CustomiOSApi 1.06

- Main Page
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Functions Enumerations Enumerator Pages
Public Types | Instance Methods | List of all members
CustomPrinter Class Reference

Class definition for CUSTOM printers. Defines functionality to print text/image, read/write data to printer, etc More...

## Public Types
enum | CommPortType { COMMTYPE_BLUETOOTH = 0, COMMTYPE_WIFI = 1, COMMTYPE_NONE = 0xFF }
| Communication Port Type More...
enum | ImageScale { IMAGE_SCALE_NONE = 0, IMAGE_SCALE_TO_FIT = 1, IMAGE_SCALE_TO_WIDTH = 2 }
| Print Image Scale More...
enum | ImageJustification { IMAGE_ALIGN_TO_LEFT = 0, IMAGE_ALIGN_TO_CENTER = -1, IMAGE_ALIGN_TO_RIGHT = -2 }
| Print Image Justification / Left Position More...
enum | CutType { CUT_TOTAL = 0, CUT_PARTIAL = 1 }
| Cut Type More...
enum | EjectType { EJ_EJECT = 0, EJ_RETRACT = 1 }
| Eject Type More...
enum | BarcodeType { BARCODE_TYPE_CODABAR = -1, BARCODE_TYPE_UPCA = -2, BARCODE_TYPE_UPCE = -3, BARCODE_TYPE_EAN13 = -4, BARCODE_TYPE_EAN8 = -5, BARCODE_TYPE_CODE39 = -6, BARCODE_TYPE_ITF = -7, BARCODE_TYPE_CODE93 = -8, BARCODE_TYPE_CODE128 = -9, BARCODE_TYPE_CODE32 = -10 }
| Barcode Type More...
enum | Barcode2DType { BARCODE_TYPE_QRCODE = -101, BARCODE_TYPE_MICROQRCODE = -102, BARCODE_TYPE_DATAMATRIX = -103, BARCODE_TYPE_PDF417 = -104, BARCODE_TYPE_MICROPDF417 = -105, BARCODE_TYPE_AZTEC = -106 }
| Barcode 2D Type More...
enum | BarcodeHriType { BARCODE_HRI_NONE = 0, BARCODE_HRI_TOP = 1, BARCODE_HRI_BOTTOM = 2, BARCODE_HRI_TOPBOTTOM = 3 }
| Barcode HRI Type More...
enum | BarcodeJustification { BARCODE_ALIGN_TO_LEFT = 0, BARCODE_ALIGN_TO_CENTER = -1, BARCODE_ALIGN_TO_RIGHT = -2 }
| Barcode Print Justification / Left Position More...

## Instance Methods
(Boolean) | - IsPrinterOnline:
| Returns if the printer is ready or not More...
(NSInteger) | - GetPrinterId:
| Returns the printer ID More...
(NSString *) | - GetFirmwareVersion:
| Returns the printer FW Release More...
(NSString *) | - GetAPIVersion
| Returns current API version More...
(NSData *) | - GetPrinterFullStatusBuffer:
| Returns the status of the printer More...
(PrinterStatus *) | - GetPrinterFullStatus:
| Returns the status of the printer More...
(NSString *) | - GetPrinterName
| Returns name/type of the Printer More...
(NSInteger) | - GetPageWidth
| Returns the max printable width in pixels / dots More...
(NSInteger) | - GetReadTimeout:
| Returns the Timeout for Communication Port Read More...
(void) | - SetReadTimeout::
| Sets the Timeout for Communication Port Read More...
(NSInteger) | - GetWriteTimeout:
| Returns the Timeout for Communication Port Write More...
(void) | - SetWriteTimeout::
| Sets the Timeout for Communication Port Write More...
(void) | - Close:
| Disconnect the link, close the communication port and release attached resources More...
(enum CommPortType) | - GetPortType
| Returns the communication port type More...
(void) | - ClearReadBuffer:
| Clears the Read Buffer of Communication Port More...
(NSData *) | - ReadData:
| Read Data Buffer from printer. It will return all available data in buffer More...
(void) | - WriteData::
| Write Data Buffer to printer More...
(void) | - Feed::
| Sends Feeds to the printer More...
(void) | - Cut::
| Sends a Cut command to the printer More...
(void) | - Eject::
| Sends a Eject command to the printer More...
(void) | - Present::
| Sends a present command to the printer More...
(void) | - PrintText:::::
(void) | - PrintTextLF:::::
| Sends the text data to printer to print and adds a LF at the end More...
(void) | - PrintText:::
| Sends the text data to printer to print. It will print data on full page width with 0 margin More...
(void) | - PrintTextLF:::
| Sends the text data to printer to print and adds a LF at the end. It will print data on full page width with 0 margin More...
(void) | - PrintTextArrayLF:::
| Sends the text data to printer to print and adds a LF at the end. It will print data on full page width with 0 margin More...
(void) | - PrintText::
| Sends the text data to printer to print. It will print data on full page width with 0 margin using the last font attributes More...
(void) | - PrintTextLF::
| Sends the text data to printer to print and adds a LF at the end. It will print data on full page width with 0 margin using the last font attributes More...
(void) | - PrintTextArrayLF::
| Sends the text data to printer to print and adds a LF at the end. It will print data on full page width with 0 margin using the last font attributes More...
(void) | - PrintImage:::::
| Sends the Bitmap data to printer to print More...
(void) | - PrintImage::
| Sends the Bitmap data to printer to print fit to paper width More...
(void) | - PrintBarcodeText:::::::
| Sends barcode Text to printer to print More...
(void) | - PrintBarcodeData:::::::
| Sends barcode data to printer to print More...
(void) | - PrintBarcode2DText:::::
| Sends barcode 2D Text to printer to print More...
(void) | - PrintBarcode2DData:::::
| Sends barcode 2D data to printer to print More...

## Detailed Description

Class definition for CUSTOM printers. Defines functionality to print text/image, read/write data to printer, etc

## Member Enumeration Documentation

- (enum) Barcode2DType

Barcode 2D Type

Enumerator
BARCODE_TYPE_QRCODE | Indicates to print a QRCODE 2D Barcode
BARCODE_TYPE_MICROQRCODE | Indicates to print a MICROQRCODE 2D Barcode
BARCODE_TYPE_DATAMATRIX | Indicates to print a DATAMATRIX 2D Barcode
BARCODE_TYPE_PDF417 | Indicates to print a PDF417 2D Barcode
BARCODE_TYPE_MICROPDF417 | Indicates to print a MICROPDF417 2D Barcode
BARCODE_TYPE_AZTEC | Indicates to print a AZTEC 2D Barcode

- (enum) BarcodeHriType

Barcode HRI Type

Enumerator
BARCODE_HRI_NONE | Indicates no HRI on the Barcode
BARCODE_HRI_TOP | Indicates HRI on TOP of the Barcode
BARCODE_HRI_BOTTOM | Indicates HRI on BOTTOM of the Barcode
BARCODE_HRI_TOPBOTTOM | Indicates HRI on TOP and BOTTOM of the Barcode

- (enum) BarcodeJustification

Barcode Print Justification / Left Position

Enumerator
BARCODE_ALIGN_TO_LEFT | Indicates that the Barcode Justification is Left
BARCODE_ALIGN_TO_CENTER | Indicates that the Barcode Justification is Center
BARCODE_ALIGN_TO_RIGHT | Indicates that the Barcode Justification is Right

- (enum) BarcodeType

Barcode Type

Enumerator
BARCODE_TYPE_CODABAR | Indicates to print a CODEBAR Barcode
BARCODE_TYPE_UPCA | Indicates to print a UPCA Barcode
BARCODE_TYPE_UPCE | Indicates to print a UPCE Barcode
BARCODE_TYPE_EAN13 | Indicates to print a EAN13 Barcode
BARCODE_TYPE_EAN8 | Indicates to print a EAN8 Barcode
BARCODE_TYPE_CODE39 | Indicates to print a CODE39 Barcode
BARCODE_TYPE_ITF | Indicates to print a ITF Barcode
BARCODE_TYPE_CODE93 | Indicates to print a CODE93 Barcode
BARCODE_TYPE_CODE128 | Indicates to print a CODE128 Barcode
BARCODE_TYPE_CODE32 | Indicates to print a CODE32 Barcode

- (enum) CommPortType

Communication Port Type

Enumerator
COMMTYPE_BLUETOOTH | Indicates that the communication port is a BLUETOOTH
COMMTYPE_WIFI | Indicates that the communication port is a WIFI
COMMTYPE_NONE | Indicates that the communication port isn't init

- (enum) CutType

Cut Type

Enumerator
CUT_TOTAL | Indicates to perform a Total Cut
CUT_PARTIAL | Indicates to perform a Partial Cut

- (enum) EjectType

Eject Type

Enumerator
EJ_EJECT | Indicates to perform a Eject or feeds to tear-off postion
EJ_RETRACT | Indicates to perform a Retract

- (enum) ImageJustification

Print Image Justification / Left Position

Enumerator
IMAGE_ALIGN_TO_LEFT | Indicates that the Picture Justification is Left
IMAGE_ALIGN_TO_CENTER | Indicates that the Picture Justification is Center
IMAGE_ALIGN_TO_RIGHT | Indicates that the Picture Justification is Right

- (enum) ImageScale

Print Image Scale

Enumerator
IMAGE_SCALE_NONE | Indicates that the Picture will be No scaling. Excess size will be ignored
IMAGE_SCALE_TO_FIT | Indicates that the Picture will be Scale to fit the paper width
IMAGE_SCALE_TO_WIDTH | Indicates that the Picture will be Scale the image to width given by width parameter

## Method Documentation

- (void) ClearReadBuffer: |  | (NSError**) | error |

Clears the Read Buffer of Communication Port

Parameters

  error | Error pointer

- (void) Close: |  | (NSError**) | error |

Disconnect the link, close the communication port and release attached resources

Parameters

  error | Error pointer

- (void) Cut: |  | (enum CutType) | cutType
: |  | (NSError**) | error

Sends a Cut command to the printer

Parameters

  cutType | Cut Type: CUT_TOTAL - Perform a Total Cut. CUT_PARTIAL - Perform a Partial Cut.
  error | Error pointer

- (void) Eject: |  | (enum EjectType) | ejectType
: |  | (NSError**) | error

Sends a Eject command to the printer

Parameters

  ejectType | Eject type: EJ_EJECT - Perform a Eject or feeds to tear-off postion. EJ_RECTRACT - Perform a Retract.
  error | Error pointer

- (void) Feed: |  | (NSInteger) | nFeeds
: |  | (NSError**) | error

Sends Feeds to the printer

Parameters

  error | Error pointer
  nFeeds | Number of LF to send

- (NSString *) GetAPIVersion |  |  |

Returns current API version

Returns
  current API version

- (NSString *) GetFirmwareVersion: |  | (NSError**) | error |

Returns the printer FW Release

Parameters

  error | Error pointer

Returns
  Returns the printer FW Release

- (NSInteger) GetPageWidth |  |  |

Returns the max printable width in pixels / dots

Returns
  Returns the max printable width in pixels / dots

- (enum CommPortType) GetPortType |  |  |

Returns the communication port type

Returns
  Returns the communication port type
  - COMMTYPE_NONE for None.
  - COMMTYPE_BLUETOOTH for Bluetooth.
  - COMMTYPE_WIFI for Wifi/Ethernet.

- (PrinterStatus *) GetPrinterFullStatus: |  | (NSError**) | error |

Returns the status of the printer

Parameters

  error | Error pointer

Returns
  Returns the status of the printer

- (NSData *) GetPrinterFullStatusBuffer: |  | (NSError**) | error |

Returns the status of the printer

Parameters

  error | Error pointer

Returns
  Returns the status of the printer. See the printer manual to understand the bit mask

- (NSInteger) GetPrinterId: |  | (NSError**) | error |

Returns the printer ID

Parameters

  error | Error pointer

Returns
  Returns the printer ID

- (NSString *) GetPrinterName |  |  |

Returns name/type of the Printer

Returns
  Returns name/type of the Printer

- (NSInteger) GetReadTimeout: |  | (NSError**) | error |

Returns the Timeout for Communication Port Read

Parameters

  error | Error pointer

Returns
  Timeout for Communication Port Read(msec)

- (NSInteger) GetWriteTimeout: |  | (NSError**) | error |

Returns the Timeout for Communication Port Write

Parameters

  error | Error pointer

Returns
  Timeout for Communication Port Write(msec)

- (Boolean) IsPrinterOnline: |  | (NSError**) | error |

Returns if the printer is ready or not

Parameters

  error | Error pointer

Returns
  Returns if the printer is ready or not

- (void) Present: |  | (NSInteger) | presentMM
: |  | (NSError**) | error

Sends a present command to the printer

Parameters

  presentMM | mm of paper to present
  error | Error pointer

- (void) PrintBarcode2DData: |  | (NSData*) | brcData
: |  | (enum Barcode2DType) | brcType
: |  | (enum BarcodeJustification) | brcJustification
: |  | (NSInteger) | brcWidth
: |  | (NSError**) | error

Sends barcode 2D data to printer to print

Parameters

  brcData | Barcode Data
  brcType | Barcode 2D Type
  brcJustification | Barcode Justification
  brcWidth | Barcode Width
  error | Error pointer

- (void) PrintBarcode2DText: |  | (NSString*) | brcText
: |  | (enum Barcode2DType) | brcType
: |  | (enum BarcodeJustification) | brcJustification
: |  | (NSInteger) | brcWidth
: |  | (NSError**) | error

Sends barcode 2D Text to printer to print

Parameters

  brcText | Barcode Text
  brcType | Barcode 2D Type
  brcJustification | Barcode Justification
  brcWidth | Barcode Width
  error | Error pointer

- (void) PrintBarcodeData: |  | (NSData*) | brcData
: |  | (enum BarcodeType) | brcType
: |  | (enum BarcodeHriType) | brcHriType
: |  | (enum BarcodeJustification) | brcJustification
: |  | (NSInteger) | brcWidth
: |  | (NSInteger) | brcHeight
: |  | (NSError**) | error

Sends barcode data to printer to print

Parameters

  brcData | Barcode Data
  brcType | Barcode Type
  brcHriType | Barcode HRI (Human Readable Information) Type
  brcJustification | Barcode Justification
  brcWidth | Barcode Width (referred to the narrow bar)
  brcHeight | Barcode Height
  error | Error pointer

- (void) PrintBarcodeText: |  | (NSString*) | brcText
: |  | (enum BarcodeType) | brcType
: |  | (enum BarcodeHriType) | brcHriType
: |  | (enum BarcodeJustification) | brcJustification
: |  | (NSInteger) | brcWidth
: |  | (NSInteger) | brcHeight
: |  | (NSError**) | error

Sends barcode Text to printer to print

Parameters

  brcText | Barcode Text
  brcType | Barcode Type
  brcHriType | Barcode HRI (Human Readable Information) Type
  brcJustification | Barcode Justification
  brcWidth | Barcode Width (referred to the narrow bar)
  brcHeight | Barcode Height
  error | Error pointer

- (void) PrintImage: |  | (UIImage*) | image
: |  | (NSError**) | error

Sends the Bitmap data to printer to print fit to paper width

Parameters

  image | Bitmap image to print
  error | Error pointer

- (void) PrintImage: |  | (UIImage*) | image
: |  | (NSInteger) | leftAlign
: |  | (enum ImageScale) | widthOption
: |  | (NSInteger) | imgWidth
: |  | (NSError**) | error

Sends the Bitmap data to printer to print

Parameters

  image | Bitmap image to print
  leftAlign | If the value is > 0, the value is the align Left align in pixel. Otherwise it can be IMAGE_ALIGN_TO_LEFT - align the print to the left. IMAGE_ALIGN_TO_CENTER - align the print to the center. IMAGE_ALIGN_TO_RIGHT - align the print to the right.
  widthOption | Scaling options: IMAGE_SCALE_NONE - No scaling. Excess size will be ignored. IMAGE_SCALE_TO_FIT - Scale to fit the paper width (see GetPageWidth). IMAGE_SCALE_TO_WIDTH - Scale the image to width given by width parameter.
  imgWidth | Printed Image width in pixel / dots (used only if widthOption=IMAGE_SCALE_TO_WIDTH)
  error | Error pointer

- (void) PrintText: |  | (NSString*) | text
: |  | (NSError**) | error

Sends the text data to printer to print. It will print data on full page width with 0 margin using the last font attributes

Parameters

  text | String to print
  error | Error pointer

- (void) PrintText: |  | (NSString*) | text
: |  | (PrinterFont*) | font
: |  | (NSError**) | error

Sends the text data to printer to print. It will print data on full page width with 0 margin

Parameters

  text | String to print
  font | Holds various font attributes
  error | Error pointer

- (void) PrintText: |  | (NSString*) | text
: |  | (NSInteger) | pixel_la
: |  | (NSInteger) | pixel_w
: |  | (PrinterFont*) | font
: |  | (NSError**) | error

Sends the text data to printer to print

Parameters

  text | String to print
  pixel_la | Left align in pixel
  pixel_w | Print area width in pixel. Pass -1 to use max available print width
  font | Holds various font attributes
  error | Error pointer

- (void) PrintTextArrayLF: |  | (NSArray*) | textarray
: |  | (NSError**) | error

Sends the text data to printer to print and adds a LF at the end. It will print data on full page width with 0 margin using the last font attributes

Parameters

  textarray | Array of Strings to print
  error | Error pointer

- (void) PrintTextArrayLF: |  | (NSArray*) | textarray
: |  | (PrinterFont*) | font
: |  | (NSError**) | error

Sends the text data to printer to print and adds a LF at the end. It will print data on full page width with 0 margin

Parameters

  textarray | Array of Strings to print
  font | Holds various font attributes
  error | Error pointer

- (void) PrintTextLF: |  | (NSString*) | text
: |  | (NSError**) | error

Sends the text data to printer to print and adds a LF at the end. It will print data on full page width with 0 margin using the last font attributes

Parameters

  text | String to print
  error | Error pointer

- (void) PrintTextLF: |  | (NSString*) | text
: |  | (PrinterFont*) | font
: |  | (NSError**) | error

Sends the text data to printer to print and adds a LF at the end. It will print data on full page width with 0 margin

Parameters

  text | String to print
  font | Holds various font attributes
  error | Error pointer

- (void) PrintTextLF: |  | (NSString*) | text
: |  | (NSInteger) | pixel_la
: |  | (NSInteger) | pixel_w
: |  | (PrinterFont*) | font
: |  | (NSError**) | error

Sends the text data to printer to print and adds a LF at the end

Parameters

  text | String to print
  pixel_la | Left align in pixel
  pixel_w | Print area width in pixel. Pass -1 to use max available print width
  font | Holds various font attributes
  error | Error pointer

- (NSData *) ReadData: |  | (NSError**) | error |

Read Data Buffer from printer. It will return all available data in buffer

Parameters

  error | Error pointer

Returns
  Data Buffer from printer. It will return all available data in buffer

- (void) SetReadTimeout: |  | (NSInteger) | msecs
: |  | (NSError**) | error

Sets the Timeout for Communication Port Read

Parameters

  error | Error pointer
  msecs | Timeout for Communication Port Read(msec)

- (void) SetWriteTimeout: |  | (NSInteger) | msecs
: |  | (NSError**) | error

Sets the Timeout for Communication Port Write

Parameters

  error | Error pointer
  msecs | Timeout for Communication Port Write(msec)

- (void) WriteData: |  | (NSData *) | data
: |  | (NSError**) | error

Write Data Buffer to printer

Parameters

  error | Error pointer
  data | Data Buffer to write to the printer