0% found this document useful (0 votes)
279 views65 pages

Seiko RP D10 iOS Programmers Guide

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
279 views65 pages

Seiko RP D10 iOS Programmers Guide

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

DPU-S245, DPU-S445,

RP-D10, RP-E10
Print Class Library for iOS
Application Programmer's Guide

U00134990801
DPU-S245, DPU-S445, RP-D10, RP-E10 Print Class Library for iOS Application Programmer's Guide

U00134990800 January 2015


U00134990801 March 2015

Copyright © 2015 by Seiko Instruments Inc.


All rights reserved.

IOS is a trademark or registered trade mark of Cisco in the U.S. and other countries and is used under
license.
iPad®, iPad Air®, iPad miniTM, iPhone®, iPod® are trademarks of Apple Inc., registered in the U.S. and
other countries.
App StoreSM is a service mark of Apple Inc.

Company names or product names may be a trademark or registered trademark.

SII reserves the right to make changes without notice to the specifications and materials contained
herein and shall not be responsible for any damages (including consequential) caused by reliance on the
materials presented, including but not limited to typographical, arithmetic, or listing errors.
Introduction

This manual describes the Print Class Library for iOS SDK (hereinafter referred to as "the SDK") for
the printers provided by Seiko Instruments Inc. (hereinafter referred to as "SII").

Target Printers
This section lists the printers supported by the SDK.

Description in
Interface Printer
This Manual
DPU-S245 Bluetooth DPU-S245-01B-E
Mobile Printer
DPU-S445 Bluetooth DPU-S445-01B-E
Bluetooth RP-D10-x27J2-Bx
RP-D10
Ethernet RP-D10-x27J1-Ex
RP-E10-x3FJ2-Bx
POS Printer Bluetooth
RP-E11-x3FJ2-Bx
RP-E10
RP-E10-x3FJ1-Ex
Ethernet
RP-E11-x3FJ1-Ex

Introduction-1
Table of Contents

Chapter 1 Product Overview 1-1

1.1 Function Provided by the SDK ................................................................................... 1-1


1.2 SII Print Class Library Overview ................................................................................ 1-1
1.2.1 SII Print Class Library Configuration .............................................................. 1-1
1.2.2 Function Provided by the Library .................................................................... 1-2
1.2.3 Application Development Used for Communication with SII Printer by
Bluetooth ........................................................................................................ 1-2

Chapter 2 Product Specification 2-1

2.1 Product Specification ................................................................................................. 2-1


2.1.1 Operating Environment .................................................................................. 2-1
2.1.2 Operating Conditions ...................................................................................... 2-3
2.1.3 Precaution ...................................................................................................... 2-3

Chapter 3 How to Use the library 3-1

3.1 Development Environment for Android Application ................................................... 3-1


3.2 Provided Files ............................................................................................................ 3-2
3.3 Build the Library into Java Eclipse Projects ............................................................. 3-3
3.3.1 Build the Library into Java Eclipse Projects.................................................... 3-3

Chapter 4 Function of the Library 4-1

4.1 Overview of the Library .............................................................................................. 4-1


4.2 Stucture of the Library................................................................................................ 4-1
4.3 API Reference ........................................................................................................... 4-1
4.3.1 SIIPrinterManager Class ................................................................................ 4-2
(1) Method List ............................................................................................... 4-2
(2) Property List .............................................................................................. 4-2
(3) Constant List ............................................................................................. 4-3
(4) Constant List of Enumerated Type ........................................................... 4-5
(5) Method Details ........................................................................................ 4-11
int Instance .............................................................. 4-13
connect Start communicating with a printer (Bluetooth) .. 4-13
connect Start communicating with a printer (TCP/IP) ...... 4-14
disconnect Disconnect a printer............................................ 4-15
sendText Send text data .................................................... 4-15
sendTextEx Send format specified text data .......................... 4-16
sendTextEx Send format specified text data .......................... 4-17
printBarcode Print barcode ...................................................... 4-18
printPDF417 Print PDF417 ...................................................... 4-20
printQRcode Print QRCode ..................................................... 4-21
TOC-1
cutPaper Cut paper ............................................................ 4-21
openDrawer Open cash drawer .............................................. 4-22
buzzer Set buzzer........................................................... 4-22
sendBinary Send binary data................................................. 4-22
sendDataFile Send specified file .............................................. 4-23
sendDataFile Send specified file .............................................. 4-24
getStatus Obtain printer status ........................................... 4-25
abort Abort the waiting state of a printer ...................... 4-27
registerLogo Register logo (image) to a printer ....................... 4-27
printLogo Print specified logo (image) on printer ................ 4-28
printLogo Print specified logo (image) on printer ................ 4-28
unregisterLogo Delete specified logo (image) on a printer .......... 4-28
registerStyleSheet Register style sheet to a printer .......................... 4-29
unregisterStyleSheet Delete sprcified style sheet on a printer ............. 4-29
resetPrinter Printer hardware reset ........................................ 4-30
getPrinterResponse Obtain various responses from a printer ............ 4-30
startDiscoveryPrinter Start printer search (Bluetooth) .......................... 4-33
startDiscoveryPrinter Start printer search (TCP/IP) .............................. 4-33
cancelDiscoveryPrinter
Cancel printer searc ........................................... 4-34
getFoundPrinter Obtain searched printer information ................... 4-34

(6) Property Details....................................................................................... 4-35


sendTimeout Obtain send timeout period ................................ 4-35
receiveTimeout Obtain receive timeout period............................. 4-35
internationalCharacter
Obtain international character set....................... 4-35
codePage Obtain codepage ................................................ 4-36
printerModel Obtain printer model ........................................... 4-36
portType Obtain connection port type ................................ 4-36
isConnect Verify connection state with a printer .................. 4-36
socketKeepingTime Socket keeping time ......................................... 4-37

4.3.2 SIIPrinterInfo Class ...................................................................................... 4-38


(1) Method List ............................................................................................. 4-38
(2) Property List ............................................................................................ 4-38
(3) Method Details ........................................................................................ 4-38
SIIPrinterInfo Constractor ......................................................... 4-38
(4) Property Details....................................................................................... 4-39
name Obtain printer model name ................................. 4-39
mac Obtain MAC address ...................................................... 4-39
ip Obtain IP address .......................................................... 4-39

4.3.3 SIIPrinterException Class ............................................................................. 4-40


(1) Method List ............................................................................................. 4-40
(2) Property List ............................................................................................ 4-40
(3) Constant List ........................................................................................... 4-41

TOC-2
(4) Method Details ........................................................................................ 4-43
SIIPrinterException Constructor ......................................................... 4-43
(5) Property Details....................................................................................... 4-29
errorCode Obtaining error codes ......................................... 4-43
errorMessage Obtain error message ......................................... 4-43

Chapter 5 Sample Program 5-1

5.1 Sample Program Overview ........................................................................................ 5-1


5.2 Sample Program Function ......................................................................................... 5-2
5.2.1 API Screen ..................................................................................................... 5-2
5.2.2 Setting Screen ................................................................................................ 5-4
5.2.3 Status Screen ................................................................................................. 5-5
5.3 Precaution .................................................................................................................. 5-6

Chapter 6 Disclaimer 6-1

TOC-3
Chapter 1
Product Overview

This chapter describes the product overview of the SDK.

1.1 Function Provided by the SDK


The SII print class library included in the SDK provides applications enabled by iOS device with the
functions to use following SII printers: DPU-S245, DPU-S445 (hereinafter referred to as "Mobile printer"),
RP-D10, RP-E10 (hereinafter referred to as "POS printer").

Moreover, the SDK includes Xcode projects for iOS device as a sample.

1.2 SII Print Class Library Overview

1.2.1 SII Print Class Library Configuration

The SII print class library (hereinafter referred to as "the library") and the sample programs included in
the SDK are located in the section surrounded by dashed lines in the iOS configuration diagram (Figure
1-1). The library consists of two classes: the class which produces printer commands, and the class
which controls communication port.

Figure 1-1

1-1
1.2.2 Function Provided by the Library

By using the library, applications can easily transmit commands and data to a printer through
communication port (Bluetooth or TCP/IP) on an iOS device. Also, applications can obtain printer status.

The library provides the following functions.

• Connection/disconnection to/from a printer

• Sending data to a printer (print data or commands*1)

• Barcode print and 2-dimensional barcode print

• Sending a data file to a printer (print data and commands*1)

• Cut paper

• Obtaining printer status

• Aborting the waiting state of a printer

• Obtaining various responses from a printer

• Printer search by TCP/IP

(NOTE) *1: Commands that obtains the response from the printer are not available.
In order to obtain responses from a printer, use "Obtaining printer status" or
"Obtaining various responses from a printer".

1.2.3 Application Development Used for Communication with SII Printer by Bluetooth

When an application used for communication with Mobile printer or POS printer by Bluetooth is
registered to App Store, SII needs to apply it in advance. For the details, contact SII.

1-2
Chapter 2
Product Specification

This chapter describes the product specification of the library.

2.1 Product Specification

2.1.1 Operating Environment

Operating environment for the library is shown in Table 2-1.

2-1
Table 2-1 Operating Environment

Type Mobile Printer POS Printer


Model DPU-S245 DPU-S445 RP-D10 RP-E10
2.01 or 2.01 or
Printer

F/W Version 2.01 or later 1.04 or later 2.01 or later 1.09 or later
later later

LAN Interface
- - - 1.13.01 or later - 1.13.01 or later
F/W Version
Interface Bluetooth Bluetooth Bluetooth Ethernet Bluetooth Ethernet

Communication
Bluetooth Bluetooth Bluetooth TCP/IP*1 Bluetooth TCP/IP*1
Port
OS
iOS 7.0 iOS 8.1 iOS 7.0 iOS 8.1 iOS 7.0 iOS 8.1 iOS 7.0 iOS 8.1 iOS 7.0 iOS 8.1
iOS Devise
iPhone 6 Plus - Supported - Supported - Supported - Supported - Supported

iPhone 6 - Supported - Supported - Supported - Supported - Supported


iPhone

iPhone 5s Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported

iPhone 5c Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported

iPhone 5 Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported

iPad Air 2 - Supported - Supported - Supported - Supported - Supported

iPad mini 3 - Supported - Supported - Supported - Supported - Supported

iPad Air Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported
iPad

iPad mini 2 Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported

iPad mini Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported

iPad (4th
Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported
generation)

iPod touch (5th


iPod

Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported
generation)

Supported Japanese
Language English
(NOTE) *1: Wireless LAN access point connected to iOS device and POS printer need to be connected to the same network.

2-2
2.1.2 Operating Conditions

This section describes the operating conditions for the library in Table 2-2 and Table 2-3.
Set the Function Setting/function selection to the values shown in each table before using the library.
See the technical reference of each printer for details about Function Setting/function selection.

Table 2-2 Function Setting of the DPU-S245/DPU-S445 When Using Bluetooth Connection

SWDIP Function Value Setting


2-1 1
Data Input Mode selection Bluetooth/USB
2-2 1
4-6 Busy Output When Error Occurs 0 Disable
4-8 Bluetooth Link Key Selection 0 Enable

Table 2-3 Function Setting When Using RP-D10/RP-E10

MS Function Value Setting


5-2 Initialized Response Selection 0 Enable

2.1.3 Precaution

When using TCP/IP connection in this library, the communication port cannot be shared with printer
drivers or other libraries.

2-3
Chapter 3
How to Use the Library

This chapter describes development environment for iOS application and how to use the library.

3.1 Development Environment for iOS Application


In order to develop iOS applications, following tools are required

• OS: Mac OS X 10.9.3 or later

• IDE: Xcode 6.0 or later

After this chapter, this manual describes on the assumption that the environment is arranged to use each
tool.

3-1
3.2 Provided Files
The file configuration of the SDK is as follows.

Figure 3-1

The file format of the library is Static Library. The file name of the library is libSIIPrinterManager.a.

3-2
3.3 Build the Library into Projects

3.3.1 Build the Library into Xcode Projects

Taking the project of the sample program (SIIPrinterManagerSample) included in the SDK as an example,
this section describes how to build the library into projects.

See "Chapter 5 Sample Program" for sample programs included in the SDK.

(a) Open the project to build into this library by Xcode.

(b) Drag the following header file provided in [Project Navigator] of the navigation window as a
target object, to an arbitrary level. (Figure 3-2)

• SIIPrinterEnum.h

• SIIPrinterException.h

• SIIPrinterManager.h

Figure 3-2

(c) Build ExternalAccessory.framework into the project. Select the target project in [Project
Navigator], go [TARGETS] - [General] - [Linked Frameworks and Libraries], open [Linked
Frameworks and Libraries], click [+], and select ExternalAccessory.framework to build into.
(Figure 3-3)

(d) Build this library into the project. As well as the previous procedure, open [Linked Frameworks
and Libraries], click [+], and select this library to build into. (Figure 3-3)

Figure 3-3
3-3
(e) Add the import definition of *.h header file to use this library or header file provided by *.m
source file as follows.

#import "SIIPrinterManager.h"

(f) Set the protocol name used by ExternalAccessory.framework. Select xxxx.plist in [Project
Navigator].
(For the sample program in this SDK, see SIIPrinterManagerSample-Info.plist.)

From the popup menu, select [Add Row] - [Supported external accessory protocols].

When open the added [Supported external accessory protocols], [Item 0] is displayed so input
"com.sii-ps.siieap" as the value.

Figure 3-4

By completing these procedures, functions of the library become available.

3-4
Chapter 4
Function of the Library

This chapter describes the APIs for each class implemented in the library.

4.1 Overview of the Library


The library provides applications enabled by iOS device with the functions to use SII printers.
See Table 4-1 Method of SIIPrinterManager Class for details about provided functions.
4.2 Structure of the Library
The file format of the library is Static Library. The file name of the library is libSIIPrinterManager.a.
In order to use the library in iOS applications, build the library into projects of applications.
See "Chapter 3 How to Use the Library" for details about how to build the library into projects.
This library includes the following classes.

Class Name Description


Class that provides the API used for communication
SIIPrinterManager
with the printer and for printing.
Class that stores the printer information searched by
SIIPinterInfo
printer searching method.
SIIPrinterException Exception class that is thrown at API call.
See "4.3 API Reference" for more details about APIs for each class.
Furthermore, add following command into *.header file of the application or *.m source file.
#import "SIIPrinterManager.h"

4.3 API Reference


This section describes API in each class included in this library. This manual describes it as follows.

Class Name Description


SIIPrinterManager See "4.3.1 SIIPrinterManager Class".
SIIPrinterInfo See "4.3.2 SIIPrinterInfo Class".
SIIPrinterException See "4.3.3 SIIPrinterException Class".

4-1
4.3.1 SIIPrinterManager Class

(1) Method List

Methods provided by the SIIPrinterManager class are shown in Table 4-1.

Table 4-1 Method of SIIPrinterManager Class


Target
Method Function Summary
Mobile POS
init Instance Supported Supported
Start communicating with a printer
connect Supported Supported
(Bluetooth).
Start communicating with a printer Not supported Supported
connect
(TCP/IP).
disconnect Disconnect a printer. Supported Supported
sendText Send text data. Supported Supported
sendTextEx Send format specified text data. Supported Not supported
sendTextEx Send format specified text data. Not supported Supported
printBarcode Print barcode. Supported Supported
printPDF417 Print PDF417. Supported Supported
printQRcode Print QR code. Supported Supported
cutPaper Cut paper. Not supported Supported
openDrawer Open cash drawer. Not supported Supported
buzzer Sound buzzer. Not supported Supported
sendBinary Send binary data. Supported Supported
sendDataFile
*1 *1
Send specified file. Supported Supported
getStatus Obtain printer status. Supported Supported
abort Abort the waiting state of a printer. Supported Supported
registerLogo Register logo (image) to a printer. Supported Supported
printLogo Print specified logo on a printer. Supported Not supported
printLogo Print specified logo on a printer. Not supported Supported
unregisterLogo Delete specified logo (image) on a printer. Supported Supported
registerStyleSheet Register style sheet to a printer. Not supported Supported
unregisterStyleSheet Delete specified style sheet on a printer. Not supported Supported
resetPrinter Printer hardware reset. Not supported Supported
getPrinterResponse
*1 *1
Obtain various responses from a printer. Supported Supported
startDiscoveryPrinter Start searching printer (Bluetooth) Supported Supported
startDiscoveryPrinter Start searching printer (TCP/IP) Not supported Supported
cancelDiscoveryPrinter Cancel printer search Not supported Supported
getFoundPrinter Obtain searched printer information Not supported Supported
*1: Provided function varies depending on the target printer.

4-2
(2) Property List

Table 4-2 Property of the SIIPrinterManager Class


Target
Property Access Function Summary
Mobile POS
sendTimeout R/W Timeout period when sending data. Supported Supported
receiveTimeout R/W Timeout period when receiving data. Supported Supported
internationalChara R/W Set international character. Supported Supported
cter
codePage R/W Code page Supported Supported
printerModel R/W Obtain printer model. Supported Supported
portType R Connecting port type Supported Supported
isConnect R Verify connection state with a printer Supported Supported
socketKeepingTime R/W Socket keeping time Not supported Supported

(3) Constant List

(a) Constants used when setting/obtaining international characters are shown in Table 4-3.
Table 4-3 Constant Name for International Character Setting
Target
Constant Name Description Value
Mobile POS
SII_PM_COUNTRY_USA U.S.A. 0 Supported Supported
SII_PM_COUNTRY_FRANCE France 1 Supported Supported
SII_PM_COUNTRY_GERMANY Germany 2 Supported Supported
SII_PM_COUNTRY_ENGLAND United Kingdom 3 Supported Supported
SII_PM_COUNTRY_DENMARK_1 DenmarkⅠ 4 Supported Supported
SII_PM_COUNTRY_SWEDEN Sweden 5 Supported Supported
SII_PM_COUNTRY_ITALY Italy 6 Supported Supported
SII_PM_COUNTRY_SPAIN Spain 7 Supported Supported
SII_PM_COUNTRY_JAPAN Japan 8 Supported Supported
SII_PM_COUNTRY_NORWAY Norway 9 Supported Supported
SII_PM_COUNTRY_DENMARK_2 DenmarkⅡ 10 Supported Supported
SII_PM_COUNTRY_SPAIN_2 SpainⅡ 11 Supported Supported
SII_PM_COUNTRY_LATIN_AMERICA Latin America 12 Supported Supported
SII_PM_COUNTRY_ARABIA Arabia 17 Not supported Supported

4-3
(b) Constants used when setting/obtaining codepage are shown in Table 4-4

Table 4-4 Constant Name for Codepage


Target
Constant Name Description Value
Mobile POS
SII_PM_CODE_PAGE_KATAKANA Set katakana character. 1 Supported Supported
SII_PM_CODE_PAGE_1252 Codepage 1252 (Latin) 16 Supported Supported
*1
SII_PM_CODE_PAGE_864 Codepage 864 (Arabic) 37 Not supported Supported
Codepage 1250
SII_PM_CODE_PAGE_1250 45 Not supported Supported
(Central European)
SII_PM_CODE_PAGE_1251 Codepage 1251 (Cyrillic) 46 Not supported Supported
SII_PM_CODE_PAGE_1253 Codepage 1253 (Greek) 47 Not supported Supported
SII_PM_CODE_PAGE_1254 Codepage 1254 (Turkish) 48 Not supported Supported
Note: This library does not support other than the above code page.
*1: When SII_PM_CODE_PAGE_864 is specified, Euro symbol is not printed.

(c) Constant used for barcode or PDF417


Constants used for printing barcode or PDF417 are shown in Table 4-5.

Table 4-5 Constant for Barcode or PDF417


Target
Constant Name Description Value
Mobile POS
SII_PM_BARCODE_HEIGHT_ Default value of barcode
162 Supported Supported
DEFAULT height
SII_PM_PDF417_ Default value of PDF417
10 Supported Supported
MODULE_HEIGHT_DEFAULT height
Automatic selection of the
SII_PM_PDF417_ROW_AUTO 0 Supported Supported
number of rows
Automatic selection of the
SII_PM_PDF417_COLUMN_AUTO 0 Supported Supported
number of columns

(d) Printer model constant


Constants used when obtaining printer model are shown in Table 4-6.

Table 4-6 Printer Model Constant


Target
Constant Name Description Value
Mobile POS
SII_PM_PRINTER_MODEL_DPU_
DPU-S245 284 Supported Not supported
S245
SII_PM_PRINTER_MODEL_DPU_
DPU-S445 281 Supported Not supported
S445
SII_PM_PRINTER_MODEL_RP_D10 RP-D10 295 Not supported Supported
SII_PM_PRINTER_MODEL_RP_D10 RP-E10 291 Not supported Supported

4-4
(e) Connecting port type constant
Constants used when obtaining connecting port type are shown in Table 4-7.

Table 4-7 Port Type Constant


Target
Constant Name Description Value
Mobile POS
SII_PM_PRINTER_PORT_TYPE_
Bluetooth 0 Supported Supported
BLUETOOTH
SII_PM_PRINTER_PORT_TYPE_TCP TCP/IP 2 Not supported Supported

(f) Response type constant


Constants used when obtaining various responses from a printer are shown in Table 4-8.

Table 4-8 Response Type Constant


Target
Constant Name Description Value
Mobile POS
SII_PM_PRINTER_RESPONSE_ Request of execution
0 Supported Supported
REQUEST response
SII_PM_PRINTER_RESPONSE_ Remaining capacity
1 Supported Supported
USER_AREA response in user area
Remaining capacity
SII_PM_PRINTER_RESPONSE_
response in user area 2 Not supported Supported
ARRANGE_USER_AREA
after defragment
SII_PM_PRINTER_RESPONSE_ Response of NV graphics
3 Not supported Supported
NV_GRAPHICS memory capacity
SII_PM_PRINTER_RESPONSE_ Key code list of defined
4 Not supported Supported
KEY_CODE NV graphics
SII_PM_PRINTER_RESPONSE_
Battery voltage status 5 Supported Not supported
BATTERY_STATUS

(4) Constant List of Enumerated Type

(a) Bold print (CharacterBold)


Enumerated type constants used for bold print are shown in Table 4-9.

Table 4-9 Bold Print (CharacterBold)


Target
Constant Name Description
Mobile POS
SII_PM_BOLD_CANCEL Release bold print. Supported Supported
SII_PM_BOLD Specify bold print Supported Supported

4-5
(b) Underline (CharacterUnderline)
Enumerated type constants used for underline are shown in Table 4-10.

Table 4-10 Underline (CharacterUnderline)


Target
Constant Name Description
Mobile POS
SII_PM_UNDERLINE_CANCEL Release underline print. Supported Supported
SII_PM_UNDERLINE_1 Specify 1 dot width underline print Supported Supported
SII_PM_UNDERLINE_2 Specify 2 dots width underline print Supported Supported

(c) Reverse print (CharacterReverse)


Enumerated type constants used for reverse print are shown in Table 4-11.

Table 4-11 Reverse Print (CharacterReverse)


Target
Constant Name Description
Mobile POS
SII_PM_REVERSE_CANCEL Release reverse print. Supported Supported
SII_PM_REVERSE Specify reverse print Supported Supported

(d) Character font (CharacterFont)


Enumerated type constants used for Character font are shown in Table 4-12.

Table 4-12 Character Font (CharacterFont)


Target
Constant Name Description
Mobile POS
SII_PM_FONT_A Font A (24×12) Supported Supported
SII_PM_FONT_B Font A (16×8) Supported Supported

4-6
(e) Character Scale (CharacterScale)
Enumerated type constants used for character scale are shown in Table 4-13.

Table 4-13 Character Scale (CharacterScale)


Target
Constant Name Description
Mobile POS
SII_PM_VARTICAL_1_HORIZONTAL_1 Height × 1 and width × 1 Supported Supported
SII_PM_VARTICAL_1_HORIZONTAL_2 Height × 1 and width × 2 Supported Supported
SII_PM_VARTICAL_1_HORIZONTAL_3 Height × 1 and width × 3 Not supported Supported
SII_PM_VARTICAL_1_HORIZONTAL_4 Height × 1 and width × 4 Not supported Supported
SII_PM_VARTICAL_2_HORIZONTAL_1 Height × 2 and width × 1 Supported Supported
SII_PM_VARTICAL_2_HORIZONTAL_2 Height × 2 and width × 2 Supported Supported
SII_PM_VARTICAL_2_HORIZONTAL_3 Height × 2 and width × 3 Not supported Supported
SII_PM_VARTICAL_2_HORIZONTAL_4 Height × 2 and width × 4 Not supported Supported
SII_PM_VARTICAL_2_HORIZONTAL_6 Height × 2 and width × 6 Not supported Supported
SII_PM_VARTICAL_3_HORIZONTAL_1 Height × 3 and width × 1 Not supported Supported
SII_PM_VARTICAL_3_HORIZONTAL_2 Height × 3 and width × 2 Not supported Supported
SII_PM_VARTICAL_3_HORIZONTAL_3 Height × 3 and width × 3 Not supported Supported
SII_PM_VARTICAL_3_HORIZONTAL_4 Height × 3 and width × 4 Not supported Supported
SII_PM_VARTICAL_4_HORIZONTAL_1 Height × 4 and width × 1 Not supported Supported
SII_PM_VARTICAL_4_HORIZONTAL_2 Height × 4 and width × 2 Not supported Supported
SII_PM_VARTICAL_4_HORIZONTAL_3 Height × 4 and width × 3 Not supported Supported
SII_PM_VARTICAL_4_HORIZONTAL_4 Height × 4 and width × 4 Not supported Supported
SII_PM_VARTICAL_4_HORIZONTAL_6 Height × 4 and width × 6 Not supported Supported
SII_PM_VARTICAL_4_HORIZONTAL_8 Height × 4 and width × 8 Not supported Supported
SII_PM_VARTICAL_6_HORIZONTAL_2 Height × 6 and width × 2 Not supported Supported
SII_PM_VARTICAL_6_HORIZONTAL_4 Height × 6 and width × 4 Not supported Supported
SII_PM_VARTICAL_6_HORIZONTAL_6 Height × 6 and width × 6 Not supported Supported
SII_PM_VARTICAL_6_HORIZONTAL_8 Height × 6 and width × 8 Not supported Supported
SII_PM_VARTICAL_8_HORIZONTAL_4 Height × 8 and width × 4 Not supported Supported
SII_PM_VARTICAL_8_HORIZONTAL_6 Height × 8 and width × 6 Not supported Supported
SII_PM_VARTICAL_8_HORIZONTAL_8 Height × 8 and width × 8 Not supported Supported

4-7
(f) Alignment (PrintAlignment)
Enumerated type constants used for alignment are shown in Table 4-14.

Table 4-14 Alignment (PrintAlignment)


Target
Constant Name Description
Mobile POS
SII_PM_ALIGNMENT_LEFT Align left Supported Supported
SII_PM_ALIGNMENT_CENTER Centered Supported Supported
SII_PM_ALIGNMENT_RIGHT Align right Supported Supported

(g) Barcode symbol (BarcodeSymbol)


Enumerated type constants used for barcode symbol are shown in Table 4-15.

Table 4-15 Barcode Symbol (BarcodeSymbol)


Target
Constant Name Description Type
Mobile POS
SII_PM_BARCODE_SYMBOL_UPC_A UPC-A (a) Supported Supported
SII_PM_BARCODE_SYMBOL_UPC_E UPC-E (a) Supported Supported
SII_PM_BARCODE_SYMBOL_EAN13 EAN13 (a) Supported Supported
SII_PM_BARCODE_SYMBOL_JAN13 JAN13 (a) Supported Supported
SII_PM_BARCODE_SYMBOL_EAN8 EAN8 (a) Supported Supported
SII_PM_BARCODE_SYMBOL_JAN8 JAN8 (a) Supported Supported
SII_PM_BARCODE_SYMBOL_CODE39 CODE39 (a), (b) Supported Supported
SII_PM_BARCODE_SYMBOL_CODE93 CODE93 (c) Not supported Supported
SII_PM_BARCODE_SYMBOL_CODE128 CODE128 (c) Supported Supported
SII_PM_BARCODE_SYMBOL_ITF ITF (a), (b) Supported Supported
SII_PM_BARCODE_SYMBOL_CODABAR CODABAR (a), (b) Supported Supported
SII_PM_BARCODE_SYMBOL_EAN13_ADDON EAN13 add-on (a) Not supported Supported
SII_PM_BARCODE_SYMBOL_JAN13_ADDON JAN13 add-on (a) Not supported Supported
For the type, see "printBarcode in 4.3.1(5) Method Details".

4-8
(h) Module size (ModuleSize)
Enumerated type constants used for module size are shown in Table 4-16.
Table 4-16 Module Size (ModuleSize)

Target
Constant Name Description Using Method
Mobile POS
SII_PM_BARCODE_MODULE_ Fine element 2 dots
Supported Supported
WIDTH_2 Module width 0.250 mm
SII_PM_BARCODE_MODULE_ Fine element 3 dots
Supported Supported
WIDTH_3 Module width 0.375 mm
SII_PM_BARCODE_MODULE_ Fine element 4 dots
printBarcode Supported Supported
WIDTH_4 Module width 0.500 mm
SII_PM_BARCODE_MODULE_ Fine element 5 dots
Not supported Supported
WIDTH_5 Module width 0.625 mm
SII_PM_BARCODE_MODULE_ Fine element 6 dots
Not supported Supported
WIDTH_6 Module width 0.750 mm
SII_PM_PDF417_MODULE_ Nominal fine element
Supported Supported
WIDTH_2 width 2 dots
SII_PM_PDF417_MODULE_ Nominal fine element
Supported Supported
WIDTH_3 width 3 dots
SII_PM_PDF417_MODULE_ Nominal fine element
Supported Supported
WIDTH_4 width 4 dots
SII_PM_PDF417_MODULE_ Nominal fine element
printPDF417 Supported Not supported
WIDTH_5 width 5 dots
SII_PM_PDF417_MODULE_ Nominal fine element
Supported Not supported
WIDTH_6 width 6 dots
SII_PM_PDF417_MODULE_ Nominal fine element
Supported Not supported
WIDTH_7 width 7 dots
SII_PM_PDF417_MODULE_ Nominal fine element
Supported Not supported
WIDTH_8 width 8 dots
SII_PM_QR_MODULE_SIZE_2 2 dots Supported Supported
SII_PM_QR_MODULE_SIZE_3 3 dots Supported Supported
SII_PM_QR_MODULE_SIZE_4 4 dots Supported Supported
SII_PM_QR_MODULE_SIZE_5 5 dots Supported Supported
SII_PM_QR_MODULE_SIZE_6 6 dots Supported Supported
printQRcode
SII_PM_QR_MODULE_SIZE_7 7 dots Supported Supported
SII_PM_QR_MODULE_SIZE_8 8 dots Supported Supported
SII_PM_QR_MODULE_SIZE_9 9 dots Supported Supported
SII_PM_QR_MODULE_SIZE_10 10 dots Supported Supported
SII_PM_QR_MODULE_SIZE_11 11 dots Supported Supported

4-9
(i) HRI character print position (HriPosition)
Enumerated type constants used for HRI character print position are shown in Table 4-17

Table 4-17 HRI Character Print Position (HriPosition)


Target
Constant Name Description
Mobile POS
SII_PM_HRI_NONE Do not print Supported Supported
SII_PM_HRI_POSITION_ABOVE Above barcode Supported Supported
SII_PM_HRI_POSITION_BELOW Below barcode Supported Supported
SII_PM_HRI_POSITION_ABOVE_
Above and below barcode (both) Supported Supported
BELOW

(j) N:W ratio (NwRatio)


Enumerated type constants used for N:W ratio are shown in Table 4-18.

Table 4-18 N:W Ratio (NwRatio)


Target
Constant Name Description
Mobile POS
SII_PM_BARCODE_WIDE_WIDTH_1 Wide width type 1 Supported Not supported
SII_PM_BARCODE_WIDE_WIDTH_2 Wide width type 2 Supported Not supported
SII_PM_BARCODE_WIDE_WIDTH_3 Wide width type 3 Supported Not supported
SII_PM_BARCODE_WIDE_WIDTH_4 Wide width type 4 Supported Not supported
SII_PM_NWRATIO_1TO2 1:2 Not supported Supported
SII_PM_NWRATIO_1TO2_5 1:2.5 Not supported Supported
SII_PM_NWRATIO_1TO3 1:3 Not supported Supported

4-10
(k) Error correction level (ErrorCorrection)
Enumerated type constants used for error correction level are shown in Table 4-19.

Table 4-19 Error Correction Level (ErrorCorrection)


Target
Constant Name Description Using Method
Mobile POS
SII_PM_PDF417_ERROR_
Error correction level 0 Supported Supported
CORRECTION_0
SII_PM_PDF417_ERROR_
Error correction level 1 Supported Supported
CORRECTION_1
SII_PM_PDF417_ERROR_
Error correction level 2 Supported Supported
CORRECTION_2
SII_PM_PDF417_ERROR_
Error correction level 3 Supported Supported
CORRECTION_3
SII_PM_PDF417_ERROR_
Error correction level 4 printPDF417 Supported Supported
CORRECTION_4
SII_PM_PDF417_ERROR_
Error correction level 5 Supported Supported
CORRECTION_5
SII_PM_PDF417_ERROR_
Error correction level 6 Supported Supported
CORRECTION_6
SII_PM_PDF417_ERROR_
Error correction level 7 Supported Supported
CORRECTION_7
SII_PM_PDF417_ERROR_
Error correction level 8 Supported Supported
CORRECTION_8
SII_PM_QR_ERROR_
Error correction level L Supported Supported
CORRECTION_L
SII_PM_QR_ERROR_
Error correction level M Supported Supported
CORRECTION_M
printQRcode
SII_PM_QR_ERROR_
Error correction level H Supported Supported
CORRECTION_H
SII_PM_QR_ERROR_
Error correction level Q Supported Supported
CORRECTION_Q

(l) PDF417 symbol (Pdf417Symbol)


Enumerated type constants used for PDF417 symbol are shown in Table 4-20.

Table 4-20 PDF417 Symbol (Pdf417Symbol)


Target
Constant Name Description
Mobile POS
SII_PM_PDF417_STANDARD Standard PDF417 Supported Supported
SII_PM_PDF417_COMPACT Compact PDF417 Supported Supported

4-11
(m) QR code model (QrModel)
Enumerated type constants used for QR code model are shown in Table 4-21.

Table 4-21 QR Code Model (QrModel)


Target
Constant Name Description
Mobile POS
SII_PM_QR_MODEL_1 QR code model 1 Supported Supported
SII_PM_QR_MODEL_2 QR code model 2 Supported Supported

(n) Cutting method (CuttingMethod)


Enumerated type constants used for cutting method are shown in Table 4-22.

Table 4-22 Cutting Method (CuttingMethod)


Target
Constant Name Description
Mobile POS
SII_PM_CUT_FULL Full cut Not supported Supported
SII_PM_CUT_PARTIAL Partial cut Not supported Supported

(o) Drawer number (DrawerNum)


Enumerated type constants used for drawer number are shown in Table 4-23.

Table 4-23 Drawer Number (DrawerNum)


Target
Constant Name Description
Mobile POS
SII_PM_DRAWER_1 Drawer 1 Not supported Supported
SII_PM_DRAWER_2 Drawer 2 Not supported Supported

(p) Activation pulse width (PulseWidth)


Enumerated type constants used for activation pulse width are shown in Table 4-24.

Table 4-24 Activation Pulse Width (PulseWidth)


Target
Constant Name Description
Mobile POS
SII_PM_ON_OFF_TIME_100 ON/OFF time 100 millisecond Not supported Supported
SII_PM_ON_OFF_TIME_200 ON/OFF time 200 millisecond Not supported Supported
SII_PM_ON_OFF_TIME_300 ON/OFF time 300 millisecond Not supported Supported
SII_PM_ON_OFF_TIME_400 ON/OFF time 400 millisecond Not supported Supported
SII_PM_ON_OFF_TIME_500 ON/OFF time 500 millisecond Not supported Supported
SII_PM_ON_OFF_TIME_600 ON/OFF time 600 millisecond Not supported Supported
SII_PM_ON_OFF_TIME_700 ON/OFF time 700 millisecond Not supported Supported
SII_PM_ON_OFF_TIME_800 ON/OFF time 800 millisecond Not supported Supported

4-12
(5) Method Details

init Instance

Target Mobile printer/POS printer

Syntax - (id) init;

Description This method initializes the instance of SIIPrinterManager class.

Return When succeeded, the initialized instance of SIIPrinterManager class is returned.


When failed, nil is returned.

Using Example SIIPrinterManager *printerManager =[[SIIPrinterManager alloc] init];

connect Start communicating with a printer (Bluetooth)

Target Mobile printer/POS printer

Syntax - (void) connect:(NSInteger)printerModel


address:(NSString)address
portType:(NSInteger)portType;

Parameter printerModel Printer model constant for Bluetooth connection


address Bluetooth device (Bluetooth accessory)
Example: "DPU-S245"
portType Port type
Example: SII_PM_PRINTER_PORT_TYPE_BLUETOOTH

Description This method starts communication between iOS device and paired printer through
Bluetooth connection. Call this method before using other methods of this class.

This method connects to the paired Bluetooth device (Bluetooth accessory) specified by
address parameter.

See Table 4-6 Printer Model Constant for available setting in printerModel parameter.

For portType parameter, specify SII_PM_PRINTER_PORT_TYPE_BLUETOOTH.

In order to operate this library properly, printer settings may be needed to change at the
connection in this method.

The Library disconnects Bluetooth connection with printer by executing disconnect


method.

Error SIIPrinterException may be thrown when the method is called.

4-13
connect Start communicating with a printer (TCP/IP)

Target POS printer

Syntax - (void) connect:(NSInteger)printerModel


address:(NSString)address
portType:(NSInteger)portType;

Parameter printerModel Printer model constant for Ethernet connection


address IP address
Example: "192.168.0.1"
portType Port type
Example: SII_PM_PRINTER_PORT_TYPE_TCP

Description This method is valid only for POS printer. This method starts communication between iOS
device and printer connected to the same network through TCP/IP connection. Call this
method before using other methods of this class.

This method connects to the IP address specified by address parameter. TCP port
number 9100 is used for communication. Also, printer default settings are executed based
on printerModel parameter which is specified at the connection. See Table 4-6 Printer
Model Constant for available printer model constant in printerModel parameter.

For the portType parameter, specify SII_PM_PRINTER_PORT_TYPE_TCP.

In order to operate a printer properly, printer settings may be needed to change at the
connection in this method.

<Introduction to creating/deleting a socket during connection with TCP/IP in the Library>

During connection with TCP/IP, the Library creates a socket when data
transmission/reception is necessary, and deletes one when unnecessary.

On the basis of data transmission completion time to a printer, a created socket is kept
until socket keeping time elapses that is set with socketKeepingTime property. The
same printer cannot be connected from other iOS application that uses this Library until
socket keeping time elapses.

After socket keeping time elapses, the socket is deleted temporarily but a socket is
created again when data is transmitted by method execution.

The Library deletes socket and disconnects the printer and TCP/IP connection by
executing disconnect method.

Error SIIPrinterException may be thrown when the method is called.

4-14
disconnect Disconnect a printer

Target Mobile printer/POS printer

Syntax - (void) disconnect;

Description This method disconnects communication with a printer.

Error SIIPrinterException may be thrown when the method is called.

sendText Send text data

Target Mobile printer/POS printer

Syntax - (void) sendText:(NSString *)text;

Parameter text Text data sent to a printer

Description This method sends the text data specified by text parameter to a printer. Data size that
can be specified at 1 time is 16K bytes (16384 bytes).

This method encodes the specified text data to printable text data based on the settings of
international character set and codepage, and then sends it to a printer.

In this method, the line spacing code is not added to the end of text data.

Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

4-15
sendTextEx Send format specified text data

Target Mobile printer

Syntax - (void) sendTextEx:(NSString *):text


bold:(CharacterBold)bold
underline:(CharacterUnderline)underline
font:(CharacterFont)font
scale:(CharacterScale)scale;

Parameter text Text data to send to a printer


bold Bold print
underline Underline
font Character font
scale Character scale

Description This method is valid only for Mobile printer. This method encodes format specified text
data to printable text data based on the settings of international character set or codepage,
and then sends it to a printer. Data size that can be specified at one time is 16K bytes
(16384 bytes).

See Table 4-9 Bold Print (CharacterBold) for available setting in bold parameter.

See Table 4-10 underline (CharacterUnderline) for available setting in underline


parameter.

See Table 4-12 Character Font (CharacterFont) for available setting in font parameter.

See Table 4-13 Character Scale (CharacterScale) for available setting in scale
parameter.

In this method, no line feed code is added at the end of text data.

Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

4-16
sendTextEx Send format specified text data

Target POS printer

Syntax - (void) sendTextEx:(NSString *):text


bold:(CharacterBold)bold
underline:(CharacterUnderline)underline
reverse:(CharacterReverse)reverse
font:(CharacterFont)font
scale:(CharacterScale)scale
alignment:(PrintAlignment)alignment;

Parameter text Text data to send to a printer


bold Bold print
underline Underline
reverse Reverse print
font Character font
scale Character scale
alignment Alignment

Description This method is valid only for POS printer. This method encodes format specified text data
to printable text data based on the settings of international character set or codepage, and
then sends it to a printer. Data size that can be specified at one time is 16K bytes (16384
bytes).

See Table 4-9 Bold Print (CharacterBold) for available setting in bold parameter.

See Table 4-10 underline (CharacterUnderline) for available setting in underline


parameter.

See Table 4-11 Reverse Print (CharacterReverse) for available setting in reverse
parameter.

See Table 4-12 Character Font (CharacterFont) for available setting in font parameter.

See Table 4-13 Character Scale (CharacterScale) for available setting in scale
parameter.

See Table 4-14 Alignment (PrintAlignment) for available setting in alignment


parameter.

In this method, no line feed code is added at the end of text data.

Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

4-17
printBarcode Print barcode

Target Mobile printer/POS printer

Syntax (a) - (void) printBarcode:(BarcodeSymbol)barcodeSymbol


text:(NSString *)text
moduleWidth:(ModuleWidth)moduleWidth
moduleHeight:(NSInteger)moduleHeight
hriPosition:(HriPosition)hriPosition
hriFont:(CharacterFont)hriFont
alignment:(PrintAlignment)alignment;

(b) - (void) printBarcode:(BarcodeSymbol)barcodeSymbol


text:(NSString *)text
moduleWidth:(ModuleWidth)moduleWidth
moduleHeight:(NSInteger)moduleHeight
hriPosition:(HriPosition)hriPosition
hriFont:(CharacterFont)hriFont
alignment:(PrintAlignment)alignment
nwRatio:(NwRatio)nwRatio;

(c) - (void) printBarcode:(BarcodeSymbol)barcodeSymbol


data:(NSData*)data
moduleWidth:(ModuleWidth)moduleWidth
moduleHeight:(NSInteger)moduleHeight
hriPosition:(HriPosition)hriPosition
hriFont:(CharacterFont)hriFont
alignment:(PrintAlignment)alignment;

Parameter barcodeSymbol Barcode symbol


text (data) Text data to send to a printer
moduleWidth Barcode width
moduleHeight Barcode height
hriPosition HRI character print position
hriFont HRI character font
alignment alignment
nwRatio N:W ratio

Description This method executes barcode print.

See Table 4-15 Barcode Symbol (BarcodeSymbol) for available setting in


barcodeSymbol parameter.

See Table 4-16 Module Size (ModuleSize) for available setting in moduleWidth
parameter.

The valid range of moduleHeight parameter is from 1 to 255.

See Table 4-17 HRI Character Print Position (HriPosition) for available setting in
hriPosition parameter.

See Table 4-12 Character Font (CharacterFont) for available setting in hriFont
parameter.

See Table 4-14 Alignment (PrintAlignment) for available setting in alignment


parameter.

4-18
See Table 4-18 N:W ratio (NwRatio) for available setting in nwRatio parameter.
Depending on the relationship between nwRatio parameter and moduleWidth
parameter, the wide element width is set in the following tables. See "Table 4-25 N:W
Ratio for Mobile Printer" for Mobile printer, and "Table 4-26 N:W Ratio for POS Printer" for
POS printer.

Table 4-25 N:W Ratio for Mobile Printer


nwRatio
moduleWidth SII_PM_BARCODE_ SII_PM_BARCODE_ SII_PM_BARCODE_ SII_PM_BARCODE_
WIDE_WIDTH_1 WIDE_WIDTH_2 WIDE_WIDTH_3 WIDE_WIDTH_4

SII_PM_BARCODE_ 0.625 mm 0.750 mm 0.750 mm 0.750 mm


MODULE_WIDTH_2 (5 dots) (6 dots) (6 dots) (6 dots)
SII_PM_BARCODE_ 0.875 mm 1.000 mm 1.125 mm 1.125 mm
MODULE_WIDTH_3 (7 dots) (8 dots) (9 dots) (9 dots)
SII_PM_BARCODE_ 1.125 mm 1.250 mm 1.375 mm 1.500 mm
MODULE_WIDTH_4 (9 dots) (10 dots) (11 dots) (12 dots)

Table 4-26 N:W Ratio for POS Printer


nwRatio
moduleWidth SII_PM_ SII_PM_ SII_PM_
NWRATIO_1TO2 NWRATIO_1TO2_5 NWRATIO_1TO3

0.500 mm 0.625 mm 0.750 mm


SII_PM_BARCODE_MODULE_WIDTH_2
(4 dots) (5 dots) (6 dots)
0.750 mm 1.000 mm 1.125 mm
SII_PM_BARCODE_MODULE_WIDTH_3
(6 dots) (8 dots) (9 dots)
1.000 mm 1.250 mm 1.500 mm
SII_PM_BARCODE_MODULE_WIDTH_4
(8 dots) (10 dots) (12 dots)
1.250 mm 1.625 mm 1.875 mm
SII_PM_BARCODE_MODULE_WIDTH_5
(10 dots) (13 dots) (15 dots)
1.500 mm 1.875 mm 2.250 mm
SII_PM_BARCODE_MODULE_WIDTH_6
(12 dots) (15 dots) (18 dots)

Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

4-19
printPDF417 Print PDF417

Target Mobile printer/POS printer

Syntax (a) - (void) pringPDF417:(NSString *)text


errorCorrection:(ErrorCorrection)errorCorrection
row:(NSInteger)row
column:(NSInteger)column
moduleWidth:(ModuleSize)moduleWidth
moduleHeight:(ModuleHeight)moduleHeight
alignment:(PrintAlignment)alignment
pdf417Symbol:(Pdf417Symbol)pdf417Symbol;

(b) - (void) pringPDF417:(NSString *)text


errorCorrection:(ErrorCorrection)errorCorrection
row:(NSInteger)row
column:(NSInteger)column
moduleWidth:(ModuleSize)moduleWidth
moduleHeight:(ModuleHeight)moduleHeight
alignment:(PrintAlignment)alignment;

Parameter text Barcode data to send a printer


errorCorrection Error correction level
row The number of row
column The number of columns in data area
moduleWidth Nominal Fine Element Width
moduleHeight Module height
alignment Alignment
pdf417Symbol Symbol of PDF417

Description This method prints PDF417. pdf417Symbol parameter for syntax (b) is fixed to standard
PDF417.

See Table 4-19 Error Correction Level (ErrorCorrection) for available setting in
errorCorrection parameter.

The valid range of row parameter is from 0 to 90. When 0 is specified, the number of row
is automatically set.

The valid range of column parameter is from 0 to 30. When 0 is specified, the number of
row in the data area is automatically set.

See Table 4-16 Module Size (ModuleSize) for available setting in moduleWidth
parameter.

The valid range of moduleHeight parameter is from 2 to 127. When make the module
height smaller, barcode reader may not read it. Specify 3 or higher in the normal use.

See Table 4-14 Alignment (PrintAlignment) for available setting in alignment


parameter.

See Table 4-20 PDF417 Symbol (Pdf417Symbol) for available setting in pdf417Symbol
parameter.

Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

4-20
printQRcode Print QR code

Target Mobile printer/POS printer

Syntax (a) - (void) printQRcode:(NSString *)text


errorCorrection:(ErrorCorrection)errorCorrection
moduleSize:(ModuleSize)moduleSize
alignment:(PrintAlignment)alignment;

(b) - (void) printQRcode:(NSString *)text


errorCorrection:(ErrorCorrection)errorCorrection
moduleSize:(ModuleSize)moduleSize
alignment:(PrintAlignment)alignment
model:(QrModel)model;
Parameter text Barcode data to send a printer
errorCorrection Error correction level
moduleSize Module Size
alignment Alignment
model QR code model

Description This method prints QR code. The type (a) is a QR code model 2 fixed.

Also the version for either type (a) or (b) is automatically set depends on the number of
data specified on text parameter.

See Table 4-19 Error Correction Level (ErrorCorrection) for available setting in
errorCorrection parameter.

See Table 4-16 Module Size (ModuleSize) for available setting in moduleSize
parameter.

See Table 4-14 Alignment (PrintAlignment) for available setting in alignment


parameter.

See Table 4-21 QR Code Model (QrModel) for available setting in the model parameter.

Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

cutPaper Cut paper

Target POS printer

Syntax - (void) cutPaper:(CuttingMethod)cuttingMethod;

Parameter cuttingMethod Cutting method

Description This method is valid only for POS printer. This method cuts paper. Cutting paper is
executed after certain paper feed to avoid cutting the print data.

See Table 4-22 Cutting Method (CuttingMethod) for available setting in cuttingMethod
parameter.

Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

4-21
openDrawer Open cash drawer

Target POS printer

Syntax - (void) openDrawer:(DrawerNum)drawerNum


onOffTime:(PulseWidth)onOffTime;

Parameter drawerNum Drawer number


onOffTime pulse width

Description This method is valid only for POS printer. This method opens the specified cash drawer.

See Table 4-23 Drawer Number (DrawerNum) for available setting in drawerNum
parameter.

See Table 4-24 Activation Pulse Width (PulseWidth) for available setting in onOffTime
parameter.

Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

buzzer Sound buzzer

Target POS printer

Syntax - (void) buzzer:(NSInteger)onTime


offTime:(NSInteger)offTime;

Parameter onTime Buzzer On time (millisecond)


offTime Buzzer Off time (millisecond)

Description This method is valid only for POS printer. This method sounds the buzzer.

The valid range of onTime and offTime parameter is from 0 to 510.

Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

sendBinary Send binary data

Target Mobile printer/POS printer

Syntax - (void) sendBinary:(NSData*)data;

Parameter data Binary data sent to a printer

Description This method sends the binary data which is specified by data parameter to a printer. Data
size that can be specified at a time is 16K bytes (16384 bytes).

In this method, specified binary data is sent to a printer without conversion.

By sending printer command as binary data with this method, printer functions which are
not supported in the library become available. However, this method does not support
commands which obtain responses from a printer.

4-22
Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

sendDataFile Send specified file

Target Mobile printer

Syntax - (void) sendDataFile:(NSString *)fileName

Parameter fileName Name of data file sent to a printer

Description This method is valid only for Mobile printer. This method determines data format based on
the file extension specified by fileName parameter, converts it to printer-enabled data
format, and sends it to a printer. The maximum file size that can be specified is 1M byte
(1048576 bytes).

When file extension is .bmp, .jpg, .jpeg, or .png:


Send data to a printer as image data. When that image data is colored one, it is converted
to monochrome image by binarization, and sent to a printer.

When file extension is .txt:


Send data to a printer as text data. Text data format supports UTF-8. Just like sendText
method, encodes the data to printable text data based on the settings of international
character set and codepage, and then sends it to a printer. Also, in this method, the line
spacing code is not added to the end of text data.

When file extension is .bin or .dat:


Data is sent to a printer as binary data without conversion.

Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

4-23
sendDataFile Send specified file

Target POS printer

Syntax - (void) sendDataFile:(NSString *)fileName


alignment:(PrintAlignment)alignment;

Parameter fileName Name of data file sent to a printer


alignment Alignment

Description This method is valid only for POS printer. This method determines data format based on
the file extension specified by fileName parameter, converts it to printer-enabled data
format, and sends it to a printer. The maximum file size that can be specified is 1M byte
(1048576 bytes).

See Table 4-14 Alignment (PrintAlignment) for available setting in alignment


parameter.

When file extension is .bmp, .jpg, .jpeg, or .png:


Send data to a printer as image data. When that image data is colored one, it is converted
to monochrome image by binarization, and sent to a printer.

When file extension is .txt:


Send data to a printer as text data. Text data format supports UTF-8. Just like sendText
method, encodes the data to printable text data based on the settings of international
character set and codepage, and then sends it to a printer. Also, in this method, the line
spacing code is not added to the end of text data.

When file extension is .bin or .dat:


Data is sent to a printer as binary data without conversion.

When file extension is .htm or .html:


Data is sent to a printer as html data without conversion.

The alignment is valid only when the file extension specified on fileName parameter
is .bmp, .jpg, .jpeg, .png, or .txt.

Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

4-24
getStatus Obtain printer status

Target Mobile printer/POS printer

Syntax - (void) getStatus:(NSInteger[])buf;

Parameter buf Status obtained from a printer

Description This method obtains printer status. Status obtained from a printer is stored to an
NSInteger array. Contents of status vary between Mobile printer and POS printer.

When specified printerModel parameter while executing connect method is


SII_PM_PRINTER_MODEL_DPU_S245 or SII_PM_PRINTER_MODEL_DPU_S445, see
the contents of Mobile printer status. When the printerModel parameter is
SII_PM_PRINTER_MODEL_RP_D10 or SII_PM_PRINTER_MODEL_RP_E10, see the
POS printer status.

The Mobile printer status is shown in Table 4-27.

Table 4-27 Printer Status (Mobile Printer)


Value
Bit Function
0 1
0 Out-of-paper error OK Error
1 Head up error OK Error
2 Vp voltage malfunction OK Error
3 Thermal head temperature error OK Error
4 Function Setting error OK Error
5
Battery voltage state See table below
6
7 Reserved - Fixed
8 to 31 Reserved Fixed -

Bit 6 Bit 5 Battery Voltage State


0 0 8.0 V or higher
0 1 7.5 V to 8.0 V
1 0 7.0 V to 7.5 V
1 1 Lower than 7.0 V

4-25
The POS printer status is shown in Table 4-28.

Table 4-28 Printer Status (POS Printer)


Value
Bit Function
0 1
0 VP voltage error OK Error
1 Hardware error OK Error
2 Head temperature error OK Error
3 Autocutter error OK Error
4 Out-of-paper error OK Error
*1
5 Paper-near-end sensor error OK Error
*1
6 Paper jam error while detecting mark OK Error
7 Cover open error OK Error
8 FEED Switch status OFF ON
9 Reserved Fixed -
10 Paper feed status Stop Operating
11 Return-waiting status No Yes
12 Reserved Fixed -
13 Reserved - Fixed
14 Reserved - Fixed
15 Drawer switch input status Low High
16 FLASH memory rewriting No Yes
17 Peripheral device selection Printer Other
18 to 31 Reserved - Fixed
*1: Supported only in RP-E10. In RP-D10, it is always OK (value: 0).

Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending or receiving.
See isConnect property for verifying connection state.

4-26
abort Abort the waiting state of a printer

Target Mobile printer/POS printer

Syntax - (void) abort;

Description When sending of image data by sendDataFile method is aborted, a printer does not
accept other processes until specified image data is received completely. (Method or sent
data are misinterpreted and recognized as part of the image data.)
To solve this situation, use this method to abort the waiting state of a printer.
Note that when executing this method, a part of unprocessed image data may be printed.

Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

registerLogo Register logo (image) to a printer

Target Mobile printer/POS printer

Syntax - (void) registerLogo:(NSString *)fileName


logoId:(NSString *)logoId;

Parameter fileName File name of image data to register as logo


logoId Logo ID to register

Description This method registers image data specified by fileName parameter to a printer as a logo.

File extension for image data supported by the parameter is .bmp, .jpg, jpeg, or .png.
The valid range of logoId parameter varies depends on the target printer.

For Mobile printer, the valid range is a character string indicating the value from 0 to 127.

For POS printer, specify by 2 characters. The valid characters are ASCII character code
from 20h (blank) to 7Eh (tilde) such as alphanumeric ('0' to '9', 'A' to 'Z', 'a' to 'z').

Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

4-27
printLogo Print specified logo (image) on printer

Target Mobile printer

Syntax - (void) printLogo:(NSString *)logoId;

Parameter logoId Logo ID to print

Description This method is valid only for Mobile printer. This method print the logo (image) registered
by registerLogo method. Specify registered logo ID in logoId parameter. The valid
range of logoId parameter is a character string indicating the value from 0 to 127.

Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

printLogo Print specified logo (image) on printer

Target POS printer

Syntax - (void) printLogo:(NSString *)logoId


alignment(PrintAlignment)alignment;

Parameter logoId Logo ID to print


alignment Alignment

Description This method is valid only for POS printer. This method print the logo (image) registered by
registerLogo method. Specify registered logo ID in logoId parameter. The valid range
of logoId parameter is 2 characters. The valid characters are ASCII character code from
20h (blank) to 7Eh (tilde) such as alphanumeric ('0' to '9', 'A' to 'Z', 'a' to 'z').

See Table 4-14 Alignment (PrintAlignment) for available setting in alignment parameter.

Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

unregisterLogo Delete specified logo (image) on a printer

Target Mobile printer/POS printer

Syntax - (void) unregisterLogo:(NSString *)logoId;

Parameter logoId Logo ID to delete

Description This method deletes the logo (image) registered by registerLogo method (for Mobile
printer). Specify registered logo ID in logoId parameter. The valid range of logoId
parameter varies depends on the target printer.

For Mobile printer, the valid range is a character string indicating the value from 0 to 127.

For POS printer, specify by 2 characters. The valid characters are ASCII character code
from 20h (blank) to 7Eh (tilde) such as alphanumeric ('0' to '9', 'A' to 'Z', 'a' to 'z').

Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

4-28
registerStyleSheet Register style sheet to a printer

Target POS printer

Syntax - (void) registerSytleSheet:(NSString *)fileName


cssId:(NSInteger)cssId;

Parameter fileName CSS file name to register as style sheet


cssId Style sheet number to register

Description This method is valid only for POS printer. This method registers CSS file specified by
fileName parameter to a printer. Maximum number of registerable style sheet is 4
sheets.

Style sheet supported by fileName parameter is that style sheet language is written in
CSS (cascading style sheets), and that file extension is .css.
Maximum number of style registerable to 1 CSS file is 64.
Also, the valid range of cssId parameter is from 1 to 4.

See "6.5.13 Tag Processing Mode" in "RP-D10 SERIES THERMAL PRINTER


TECHNICAL REFERENCE" or "RP-E10 SERIES THERMAL PRINTER TECHNICAL
REFERENCE" for more details about style sheet.

Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

unregisterStyleSheet Delete specified style sheet on a printer

Target POS printer

Syntax - (void) unregisterStyleSheet:(NSInteger)cssId;

Parameter cssId Style sheet number to delete

Description This method is valid only for POS printer. This method deletes the style sheet registered
by registerStyleSheet method.
Specify the registered style sheet number for cssId parameter.
The valid range of cssId parameter is from 1 to 4.

Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

4-29
resetPrinter Printer hardware reset

Target POS printer

Syntax - (void) resetPrinter;

Description This method is valid only for POS printer. This method is available only when specified
portType parameter is SII_PM_PRINTER_PORT_TYPE_TCP while executing connect
method. This method resets a connected printer by using the SII original command (reset
command) to TCP port number 26100. After executing this method, connection to a printer
is maintained.

Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.

getPrinterResponse Obtaining various responses from a printer

Target Mobile printer/POS printer

Syntax - (void) getPrinterResponse:(NSInteger)responseId


param:(NSObject *)param
response:(void *)response;

Parameter responseId Response type constant


param Response code of execution response request
response Buffer that stores obtained response data
(Buffer type varies depending on a response type constant.)

Description This method stores the response data specified by responseId parameter to the object
specified by response parameter. See Table 4-8 Response Type Constant for available
constants for responseId parameter. Contents of obtainable response from a printer
vary between Mobile printer and POS printer.

When specified printerModel parameter while executing connect method is


SII_PM_PRINTER_MODEL_DPU_S245 or SII_PM_PRINTER_MODEL_DPU_S445, see
the contents of obtained response for Mobile printer. When the printerModel parameter
is SII_PM_PRINTER_MODEL_RP_D10 or SII_PM_PRINTER_MODEL_RP_E10, see the
contents of obtained response for POS printer.

4-30
Contents of obtained response for Mobile printer are shown in Table 4-29.

Table 4-29 Contents of Obtained Response (Mobile Printer)

Constant Name Description

Obtains execution response request.


Specify 0 to 15 (00h~0Fh) of NSData to param parameter.
SII_PM_PRINTER_RESPONSE_ Specify NSInteger array with the length of 1 to response
REQUEST parameter.
When responses are obtained successfully, 80 to 95 (50h~5Fh)
is stored to the response parameter.
Obtains remaining user area response.
Specify nil to param parameter.
SII_PM_PRINTER_RESPONSE_ Specify NSInteger array with the length of 1 to response
USER_AREA parameter.
When responses are obtained successfully, remaining user
area is stored to the response parameter in byte value.
Obtains battery voltage status.
Specify nil to param parameter.
Specify NSInteger array with the length of 1 to response
SII_PM_PRINTER_RESPONSE_
parameter.
BATTERY_STATUS
When responses are obtained successfully, the battery status
value is stored to the response parameter.
Meanings of battery status values are as follows.

Battery Status Value Battery Voltage State


0 8.0 V or higher
1 7.5 V to 8.0 V
2 7.0 V to 7.5 V
3 Lower than 7.0 V

4-31
Contents of obtained response for POS printer are shown in Table 4-30.

Table 4-30 Contents of Obtained Response (POS Printer)

Constant Name Description

Obtains execution response request.


Specify 0 to 15 (00h~0Fh) of NSData to param parameter.
SII_PM_PRINTER_RESPONSE_ Specify NSInteger array with the length of 1 to response
REQUEST parameter.
When responses are obtained successfully, 128 to 143
(80h~8Fh) is stored to response parameter.
Obtains remaining user area response.
Specify nil to param parameter.
SII_PM_PRINTER_RESPONSE_ Specify NSInteger array with the length of 1 to response
USER_AREA parameter.
When responses are obtained successfully, remaining user
area is stored to response in byte value.
Obtains remaining memory response after user area
defragment.
Specify nil to param parameter.
SII_PM_PRINTER_RESPONSE_ Specify NSInteger array with the length of 1 to response
ARRANGE_USER_AREA parameter.
When responses are obtained successfully, remaining memory
after user area defragment is stored to response parameter in
byte value.
Obtains NV graphics memory capacity response.
Specify nil to param parameter.
SII_PM_PRINTER_RESPONSE_ Specify NSInteger array with the length of 1 to response
NV_GRAPHICS parameter.
When responses are obtained successfully, NV graphics
memory capacity is stored to response in byte value.
Obtains the key code list defined NV graphics.
Specify nil to param parameter.
SII_PM_PRINTER_RESPONSE_
Specify NSMutableArray array to response parameter.
KEY_CODE
When responses are obtained successfully, the key code of NV
graphics is stored to response parameter in string array.

Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending or receiving.
See isConnect property for verifying connection state.

4-32
startDiscoveryPrinter Start printer search (Bluetooth)

Target Mobile printer/POS printer

Syntax - (void)startDiscoveryPrinter:(NSPredicate *)predicate


completion:(EABluetoothAccessoryPickerCompletion)completion;

Parameter predicate Specify nil.


completion Event completion of
EABluetoothAccessoryPickerCompletion

Description This method searches Bluetooth device (Bluetooth accessory). This method calls
showBluetoothAccessoryPickerWithNameFilter of EAAccessoryManager
internally. When executing this method, paring with Bluetooth device is enable in the
displayed window.

Specify ^ (NSError *error) to completion parameter in order to receive event


completion of EABluetoothAccessoryPickerCompletion.

(cf.) Statement of EABluetoothAccessoryPickerCompletion


typedef void(^EABluetoothAccessoryPickerCompletion)
(NSError *error);

Error SIIPrinterException may be thrown when this method is called.

startDiscoveryPrinter Start printer search (TCP/IP)

Target POS printer

Syntax - (void)startDiscoveryPrinter:(NSInteger)retryCount
timeout:(NSInteger)timeout
completion:(SIIDiscoveryPrinterCompletion)completion;

Parameter retryCount Retry count


timeout Searching timeout period
completion Event completion of printer search

Description This method is valid only for POS printer. This method is available only when specified
portType parameter is SII_PM_PRINTER_PORT_TYPE_TCP while executing connect
method. This method sends local broad cast packet and search SII printer. Completion or
cancellation of searching is notified to a block specified in completion parameter as an
event.

This method sends local broad cast packet as the number of times specified in
retryCount parameter, and waits for response from the printer until the searching
timeout period specified in timeout parameter. The searching printer information can be
obtained by getFoundPrinter method.

The definition of SIIDiscoveryPrinterCompletion is as follows.


typedef void(^SIIDiscoveryPrinterCompletion)(NSArray *printerList);

In order to use this method, LAN interface F/W version needs to be 1.13.01 or later.

Error SIIPrinterException may be thrown when this method is called.

4-33
cancelDiscoveryPrinter Cancel printer search

Target POS printer

Syntax - (void)cancelDiscoveryPrinter;

Description This method is valid only for POS printer. This method is available only when specified
portType parameter is SII_PM_PRINTER_PORT_TYPE_TCP while executing connect
method. This method cancels executing startDiscoveryPrinter method.
Cancellation of searching is notified to a block specified in completion parameter as an
event.

getFoundPrinter Obtain searched printer information

Target POS printer

Syntax - (NSArray *)getFoundPrinter;

Parameter This method is valid only for POS printer. This method is available only when specified
portType parameter is SII_PM_PRINTER_PORT_TYPE_TCP while executing connect
method. This method returns the printer information searched by printer search as
NSArray type. For the details of printer information, see SIIPrinterInfo class
described later.

Return value Printer information of NSArray type

4-34
(6) Property Details

sendTimeout Timeout period when sending data

Target Mobile printer/POS printer

Syntax @property NSInteger sendTimeout;

Description This property maintains the timeout period when data is sent. This property is configurable
or obtainable whether a printer is connected or not. However, the configured timeout
period is enabled at the next data sending. When the configured value is outside of the
valid range, 100 is set when the set value is lower than 100, or 300000 is set when the set
value is more than 300000.

Default 10000 msec (10 seconds)


Effective range 100 msec to 300000 msec (5 minutes)

receiveTimeout Timeout period when receiving data

Target Mobile printer/POS printer

Syntax @property NSInteger receiveTimeout;

Description This property maintains the timeout period when data is received. This property is
configurable or obtainable whether a printer is connected or not. When the configured
value is outside of the valid range, 100 is set when the set value is lower than 100, or
300000 is set when the set value is more than 300000.

Default 10000 msec (10 seconds)


Effective range 100 msec to 300000 msec (5 minutes)

internationalCharacter Set international character set

Target Mobile printer/POS printer

Syntax @property NSInteger internationalCharacter;

Description This property maintains the configuration of international character set. When text data is
send by sendText method, sendTextEx method, or sendDataFile method, the print
result for the following character differs depending on the international character setting
value.

The character code differs depending on the international character setting value:
0x23, 0x24, 0x40, 0x5B, 0x5C, 0x5D, 0x5E, 0x60, 0x7B, 0x7C, 0x7D, 0x7E

See Table 4-3 Constant Name for International Character setting for details about
configurable values. When international character set is not configured, it is initialized to
following state depending on a language setting of an iOS device. Also, when invalid value
is specified, it is ignored.

When a language setting of an iOS device is Japanese:


SII_PM_COUNTRY_JAPAN

When a language setting of an iOS device is other languages than Japanese:


SII_PM_COUNTRY_USA

4-35
codePage Code page

Target Mobile printer/POS printer

Syntax @property NSInteger codePage;

Description This property maintains setting values of codepage. The encoder used for sending text
data by sendText method, sendTextEx method, or sendDataFile method is changed
depends on the codepage setting. See Table 4-4 Constant Name for Codepage for the
details about configurable values. When a codepage is not configured, it is initialized to
the following state depending on a language setting of an iOS device. Also, when invalid
value is specified, it will be ignored.

When a language setting of an iOS device is Japanese:


SII_PM_CODE_PAGE_KATAKANA

When a language setting of an iOS device is other languages than Japanese:


SII_PM_CODE_PAGE_1252

printerModel Obtain printer model

Target Mobile printer/POS printer

Syntax @property(readonly) NSInteger printerModel;

Description This property obtains a model value for the connected printer. When a printer is not
connected, -1 is returned.

Return value See Table 4-6 Printer Model Constant for details.

Default -1

portType Connecting port type

Target Mobile printer/POS printer

Syntax @property(readonly) NSInteger portType;

Description This property obtains the port type of connecting printer in use during connection with a
printer. When a printer is not connected, -1 is returned.

Return value See Table 4-7 Port Type Constant for details.

Default -1

isConnect Verify connection state with a printer

Target Mobile printer/POS printer

Syntax @property(readonly) BOOL isConnect;

Description This property maintains BOOL value with a printer. Maintains YES when a printer is
connected and NO when the printer is disconnected. When SIIPrinterException is
thrown during data sending and the printer is disconnected, NO is returned in this property.
When NO is returned, reconnect with the printer is needed by connect method.

Return value Following values are returned depending on the connection state with a printer.
4-36
YES Connected to a printer
NO Disconnected to a printer

socketKeepingTime Socket keeping time

Target POS printer

Syntax @property NSInteger socketKeepingTime;

Description This method is valid only for POS printer. This property maintains the setting of socket
keeping time during TCP/IP connection. For socket keeping time, set the same time as
Network Printer Receive. See "RP-D10/RP-E10 SERIES LAN INTERFACE TECHNICAL
REFERENCE" for more details about Network Printer Receive Timeout.
This property is configurable and obtainable whether a printer is connected or not.
However, socket keeping time is enabled at the next execution of connect method
(TCP/IP). Moreover, when configured value is outside of the valid range, set 6000 when
the set value is lower than 6000 and set 300000 when the set value is more than 300000.

Default 300000msec (5 minutes)


Effective range 60000 to 300000msec (5 minutes)

4-37
4.3.2 SIIPrinterInfo Class
This class stores printer information searched by printer search method. This class obtains printer model,
MAC address, and IP address from the searched printer information.

(1) Method List

This class stores the printer information searched by printer searching method. This class obtains printer
model, MAC address, and IP address from the searched printer information.
The list of methods provided by SIIPrinterInfo class is shown in Table 4-31.

Table 4-31 Method of SIIPrinterInfo Class


Target
Method Function Summary
Mobile POS
SIIPrinterInfo Constructor for printer information class Not supported Supported

(2) Property List

The list of methods provided by the SIIPrinterInfo class is shown in Table 4-32.

Table 4-32 Property of SIIPrinterInfo Class


Target
Method Access Function Summary
Mobile POS
name R Obtain printer model name Not supported Supported
mac R Obtain MAC address Not supported Supported
ip R Obtain IP address Not supported Supported

(3) Method Details

SIIPrinterInfo Constractor

Target POS printer

Syntax SIIPrinterInfo

Description This method is valid only for POS printer. This method is used for storing printer
information searched by printer searching method.

4-38
(4) Property Details

name Obtain printer model name

Target POS printer

Syntax @property NSString *name;

Description This property is valid only for POS printer. This property obtains printer model name
searched by printer searching method.

mac Obtain MAC address

Target POS printer

Syntax @property NSString *mac;

Description This property is valid only for POS printer. This property obtains MAC address searched
by printer searching method.

ip Obtain IP address

Target POS printer

Syntax @property NSString *ip;

Description This property is valid only for POS printer. This property obtains IP address searched by
printer searching method.

4-39
4.3.3 SIIPrinterException Class

(1) Method List

The list of methods provided by SIIPrinterException class is shown in Table 4-33.

Table 4-33 Method of SIIPrinterException Class


Target
Method Function Summary
Mobile POS
Exception class thrown when API for
SIIPrinterException SIIPrinterManager class is Supported Supported
called.

(2) Property List

The list of property provided by the SIIPrinterException class is shown in Table 4-34

Table 4-34 Property of SIIPrinterException Class


Target
Property Access Function Summary
Mobile POS
errorCode R Obtain error code Supported Supported
errorMessage R Obtain error message Supported Supported

4-40
(3) Constant List

Constants used for obtaining error codes are shown in Table 4-35.

Table 4-35 Error Codes List


Target
Constant Name Description Value
Mobile POS
*1
SII_PM_ERROR_ Failed to obtain the handle. Supported Supported
-1
ACCESS_DENIED Unavailable port specified. Supported Supported
SII_PM_ERROR_
Already opened port specified. -11 Supported Supported
SHARING_VIOLATION
SII_PM_ERROR_
Port not opened. -12 Supported Supported
PORT_NOT_OPENED
Specified printer with Bluetooth
Supported Supported
SII_PM_ERROR_DEVICE_ device name does not exist.
-21
NOT_CONNECTED Specified IP address printer does
Not supported Supported
not exist.
Failed to change the printer setting.
Data sending to printer is not
SII_PM_ERROR_DEVICE_ completed within the sending
-31 Supported Supported
INITIALIZE_FAILED timeout period, or data receiving
from printer is not completed within
the receiving timeout period.
SII_PM_ERROR_
0-byte data specified. -101 Supported Supported
DATA_SIZE_ZERO
SII_PM_ERROR_ The data size exceeds the
-102 Supported Supported
OVER_MAX_DATA_SIZE maximum value.
SII_PM_ERROR_ Error occurred in encoding text
*1 -111 Supported Supported
ENCODE_FAILED data.
SII_PM_ERROR_ Send timeout happened. Supported Supported
-201
TIMEOUT Receive timeout happened. Supported Supported
SII_PM_ERROR_
Specified file not found. -301 Supported Supported
FILE_NOT_FOUND
The process cannot access the file
SII_PM_ERROR_
because it is being used by another -302 Supported Supported
FILE_USED
process.
SII_PM_ERROR_
Invalid file specified. -303 Supported Supported
FILE_INVALID
SII_PM_ERROR_ Insufficient memory when loading
-311 Supported Supported
LOW_MEMORY image data file.
Either width or height of image
SII_PM_ERROR_
data, or both of them exceed the -312 Supported Supported
OVER_MAX_IMAGE
number of printable maximum dots.
SII_PM_ERROR_
Logo is not specified. -313 Not supported Supported
LOGO_NOT_DEFINED
SII_PM_ERROR_
Insufficient remaining user area. -401 Supported Supported
LOW_USER_AREA
SII_PM_ERROR_ Insufficient remaining RAM
-402 Supported Not supported
LOW_EXTERNAL_RAM capacity.

4-41
Target
Constant Name Description Value
Mobile POS
SII_PM_ERROR_ Inappropriate value specified for
-501 Not supported Supported
INVALID_NO style sheet number.
The number of style registered in
SII_PM_ERROR_
the specified file exceeds rated -502 Not supported Supported
OVER_STYLE_NUM
value (64).
SII_PM_ERROR_
Invalid parameter specified. -9999 Supported Supported
INVALID_PARAM
*1 Abnormality processing might have happened.

4-42
(4) Method Details

SIIPrinterException Constructor

Target Mobile printer/POS printer

Syntax SIIPrinterException

Description Exception class thrown when API for SIIPrinterManager class is called.

(5) Property Details

errorCode Obtain error codes

Target Mobile printer/POS printer

Syntax @property NSInteger errorCode;

Description This method obtains exception error code thrown.

Return value See Table 4-29 Error Codes List for details.

errorMessage Obtain error message

Target Mobile printer/POS printer

Syntax @property NSString *errorMessage;

Description This method obtains exception error message thrown. Character string to complement
errorCode property can be obtained.

4-43
Chapter 5
Sample Program

This chapter describes the sample programs provided by the SDK.

5.1 Sample Program Overview


The SDK includes Xcode project format.

SIIPrinterManagerSample Project Screen

Figure 5-1 API Screen Figure 5-2 Setting Screen Figure 5-3 Status Screen

5-1
5.2 Sample Program Function
This section describes the functions of the sample program.

5.2.1 API Screen

(1)

(2)
(3) (4)
(5) (6)

(7) (8)

(9) (10)

(11) (12)

(13) (14)

(15) (16)
(17) (18)
(19) (20)
(21) (22)

(23)

Figure 5-4 Sample Program Function

5-2
Functions of the sample program are shown in Table 5-1.

Table 5-1 Functions of the Sample Program

No. Description Remarks


Selects connection form to a printer.
(1) Connection type Select [Bluetooth] for Mobile printer.
Select [TCP/IP] or [Bluetooth] for POS printer.
Depends on the selection of the connection type, the procedure
varies as follows.
When connecting through TCP/IP:
Input IP address for a printer.
Example: "192.168.0.1"
After tapping [List] button, the list of devices searched by
startDiscoveryPrinter (TCP/IP) method, is displayed.
(2) Address By selecting a printer from the list, IP address can be entered.
When connecting through Bluetooth:
IP address cannot be entered.
When executing connect method, Bluetooth device name
(Bluetooth accessory name) for paired printer is displayed.
After tapping [List] button, the list of Bluetooth device name
(Bluetooth accessory name) searched by
startDiscoveryPrinter (Bluetooth) method.
Executes connect method.
When connecting through TCP/IP, the IP address specified by the
(3) connect Address method becomes connection target.
When connecting through Bluetooth, the printer selected from the
paring printer list becomes connection target.
(4) disconnect Executes disconnect method.
(5) sendText Executes sendText method.
(6) sendTextEx Executes sendTextEx method.
(7) printBarcode Executes printBarcode method.
(8) printPDF417 Executes printPDF417 method.
(9) printQRcode Executes printQRcode method.
(10) cutPaper Executes cutPaper method.
(11) openDrawer Executes openDrawer method.
(12) buzzer Executes buzzer method.
(13) sendBinary Executes sendBinary method.
(14) sendDataFile Executes sendDataFile method.
(15) getStatus Executes getStatus method.
(16) abort Executes abort method.
(17) getPrinterResponse Executes getPrinterResponse method.
(18) registerLogo Executes registerLogo method.
(19) printLogo Executes printLogo method.
(20) unregisterLogo Executes unregisterLogo method.
(21) registerStyleSheet Executes registerStyleSheet method.
(22) unregisterStyleSheet Executes unregisterStyleSheet method.
(23) resetPrinter Executes resetPrinter method.

5-3
5.2.2 Setting Screen

(1)

(2)

(3)

(4)

(5)

Figure 5-5 Setting Screen

Functions for settings screen are shown in Table 5-2.

Table 5-2 Settings Screen

No. Description Remarks


Sets the time until send timeout happens in msec
(1) Send timeout (msec) (millisecond). The text entry screen is displayed in another
window.
Sets the time until receive timeout happens in msec
(2) Receive timeout (msec) (millisecond). The text entry screen is displayed in another
window.
Sets the socket keeping time in msec (millisecond). The text
(3) Socket Keeping time (msec)
entry screen is displayed in another window.
Sets international character set. This is the international
character set configuration for printer side when printing
(4) International character texts (when text files are specified by the sendText
method, sendTextEx method, or the sendDataFile
method).

5-4
No. Description Remarks
Sets codepage. This is the encoding and the character set
configuration value for printer side when printing texts (when
(5) Code page
text files are specified by the sendText method,
sendTextEx method, or the sendDataFile method).

5.2.3 Status Screen

(1)

(2)

(3)

Figure 5-6 Status Screen

Functions for status screen are shown in Table 5-3.

Table 5-3 Status Screen

No. Description Remarks


(1) Connection status Indicates connection status.
(2) Port type Indicates connecting port type.
(3) Pritner model Indicates connecting printer model.

5-5
5.3 Precaution
No guarantee of proper operation and support are provided for sample programs.

Sample programs are subject to change without notice.

5-6
Chapter 6
Disclaimer

We closely monitor the development of this software in order to avoid problems. However, we are not
responsible for any damages arising out of the use of this software.

6-1

You might also like