Native App Print for Windows
API Download
SDK Download for WindowsReference Guide
mPOS Controller Devices
1 OverviewMPosControllerDevices Class provides basic functions with regards to the device, and the events and functions included in this class can be used in the classes of all devices.
2 Common Events
The event methods used in each SDK are as follows.
Event name |
iOS SDK |
Android SDK |
Windows SDK |
DataEvent |
NSNotification |
DataListener |
Callback function |
StatusUpdateEvent |
NSNotification |
StatusUpdateListener |
Callback function |
1) DataEvent
If data entry occurs in B-gate or a device connected to B-gate, the data will be sent to the application through the registered event.
If the status of a device changes, the new status will be sent to the application through the registered event. The data transmission and processing status of each host will be sent from the multi-host environment. The sent value is an integer type constant value that has been defined in advance.
Code |
Value |
Description |
MPOS_STATUS_NORMAL |
0 |
Printing is possible |
MPOS_STATUS_PRINTER_COVEROPEN |
1006 |
Cover is open |
MPOS_STATUS_PRINTER_PAPEREMPTY |
1007 |
No paper |
MPOS_STATUS_PRINTER_PAPER_NEAREND |
1004 |
Insufficient paper |
MPOS_STATUS_PRINTER_ERROR |
1000 |
Error |
MPOS_STATUS_BUSY |
1200 |
Communicating with another host |
MPOS_STATUS_PROGRESS |
1201 |
Transmitting |
MPOS_STATUS_COMPLETED |
1202 |
Transmission complete |
MPOS_STATUS_REQUIRE_RESET |
1203 |
B-gate reset required |
MPOS_STATUS_FAIL |
1204 |
Transmission failed |
3 Data Types
The data type defined in the manual is defined as follows according to the SDK.
Data Types |
iOS SDK |
Android SDK |
Windows SDK |
int |
NSInteger |
Int |
int |
long |
long |
long |
long |
boolean |
BOOL |
Boolean |
BOOL |
string |
NSString* |
String |
LPCTSTR |
RawData |
NSData* |
byte[] |
char* |
ImageData |
UIImage* |
Bitmap |
char* |
char |
char |
String |
LPCTSTR |
list |
NSArray |
Set |
- |
4 Methods
Configures the interface type and address of the B-gate you wish to connect.
This function must be used before calling the openService function.
[Syntax]
long selectInterface(int interfaceType, string address);
[Parameters]
Select the interface typr of int interfaceType: B-gate.
Code |
Value |
Description |
MPOS_INTERFACE_WIFI |
1 |
Use when connecting to Wi-Fi. |
MPOS_INTERFACE_ETHERNET |
2 |
Use when connecting to Ethernet. |
MPOS_INTERFACE_BLUETOOTH |
4 |
Use when connecting to Bluetooth. |
MPOS_INTERFACE_USB |
16 |
Use when connecting to USB. Only supports Windows SDK. |
string address: Enter the interface address value of B-gate.
For Ethernet, use the “IP address [:tcp port number]” format. The tcp port number can be omitted, and the default value is 9100. If the tcp port number of B-gate has been changed, the new number must be used. For a Bluetooth interface, the appropriate value according to the type of SDK must be entered.
SDK Types |
Address value |
iOS SDK |
Serial number of B-gate |
Android SDK |
Bluetooth MAC Address |
Windows SDK |
Paired COM port number |
For a USB interface, it can be used only in Windows SDK and it will automatically search for connected devices.
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_OPENED |
1010 |
Called after openService function |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Parameter is invalid |
MPOS_FAIL |
1000 |
Failed |
Configures whether the host and the relevant device will communicate directly or through B-gate. This function must be used before the calling the openService function.
If this function is not used, it will be configured as the default value. If communicating with the device directly, make sure to call this function.
Caution |
The products that can communicate with the device directly are SRP-Q300/Q302 and BCD-2000/3000. |
[Syntax]
long selectCommandMode(int commandMode);
[Parameters]
int commandMode: Select the mode to communicate with B-gate or a device.
Code |
Value |
Description |
MPOS_COMMAND_MODE_DEFAULT |
0 |
Communicate through B-gate (default value) |
MPOS_COMMAND_MODE_BYPASS |
1 |
Direct communication |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_OPENED |
1010 |
Called after openService function |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Parameter is invalid |
MPOS_FAIL |
1000 |
Failed |
3) setTimeout
Configures the timeout value (unit: seconds) when the openService function is running.
The default value of the timeout will be applied if this function is not used. This function must be used before calling the openService function.
[Syntax]
long setTimeout(int timeout);
[Parameters]
int timeout: Use only values larger than 0 (default value: 3 seconds)
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_OPENED |
1010 |
Called after openService function |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Initializes the device with the smallest Device Id value out of the relevant devices connected to B-gate.
[Syntax]
long openService(void);
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_ALREADY_OPEN |
1 |
It is already connected |
MPOS_FAIL_NOT_CONNECT |
1006 |
B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to B-gate |
MPOS_FAIL_NO_RESPONSE |
1005 |
No response |
MPOS_FAIL |
1000 |
Failed |
5) openService(int openDeviceId)
Initializes the usable relevant device by having the openDeviceId value as the smallest
value. For Windows SDK, the openServiceById function must be used instead of the
openService function.
[Syntax]
long openService(int openDeviceId);
long openServiceById(int openDeviceId); // only Windows SDK applies
[Parameters]
int openDeviceId: The smallest value within the Id range of each device. Only a value that lies within the range of each device can be used.
Device types |
Id range |
Label Printer |
1~9 |
POS Printer |
10~19 (number 10 is B-gate solid type printer) |
HID |
20~29 |
MSR |
30~39 |
Barcode Scanner |
40~49 |
RFID |
60~69 |
Dallas Key |
70~79 |
NFC |
80~89 |
Customer Display |
110~119 |
USB-to-Serial |
120~129 |
Scale |
130~139 |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_ALREADY_OPEN |
1 |
It is already connected |
MPOS_FAIL_NOT_CONNECT |
1006 |
B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to B-gate |
MPOS_FAIL_NO_RESPONSE |
1005 |
No response |
MPOS_FAIL |
1000 |
Failed |
6) closeService(int closeTimeout)
Ends the use of a device.
[Syntax]
long closeService (int closeTimeout);
[Parameters]
int closeTimeout: Use a value (unit: seconds) larger than or use the constant value below.
Code |
Value |
Description |
MPOS_CLOSE_TIMEOUT_IMMEDIATELY |
0 |
End immediately when function is called |
MPOS_CLOSE_TIMEOUT_INFINITE |
-1 |
End after sending transmission buffer data |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_ALREADY_OPEN |
1 |
It is already connected |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to B-gate |
MPOS_FAIL_NO_RESPONSE |
1005 |
No response |
MPOS_FAIL |
1000 |
Failed |
Returns the usable status of the relevant device.
[Syntax]
long isOpen(void);
[Return Values]
Return value |
Description |
true |
Device can be used |
false |
Device cannot be used |
Returns the Device Id of the relevant device.
[Syntax]
long getDeviceId(void);
[Return Values]
Code |
Value |
Description |
Device Id of the relevant device |
# |
Device Id value of the device |
MPOS_FAIL_NO_OPEN |
1002 |
Device cannot be used |
MPOS_FAIL |
1000 |
Failed |
Instantly sends data to the relevant device.
[Syntax]
long directIO(RawData data);
long directIO(RawData data, int dataLength); //only Windows SDK applies
For Windows SDK, the data and dataLength must be used together in the parameter.
[Parameters]
RawData data: Data to be sent to device.
int dataLength: Length of the data to be sent to device. Only Windows SDK applies
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NO_OPEN |
1002 |
Device cannot be used |
MPOS_FAIL |
1000 |
Failed |
Configures the Transaction mode or cancels it after sending Transaction data to B-gate.
Using the Transaction mode in a multi-host environment will guarantee data integrity between hosts. If another host is communicating with B-gate, the transmission and processing of sent data may be delayed, while the processing results of data in B-gate can be checked through StatusUpdateEvent.
Caution |
It is recommended to use the Transaction mode in multi-host environments when using output devices such as printers, Customer displays, label printers, etc. |
[Syntax]
long setTransaction(int mode);
[Parameters]
int mode: Configure the transaction mode
Code |
Value |
Description |
MPOS_TRANSACTION_IN |
1 |
Enter transaction mode |
MPOS_TRANSACTION_OUT |
0 |
Cancel transaction mode after data transmission |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
The Function has been succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_TRANSACTION_ALREADY_IN |
1015 |
Already in transaction mode |
MPOS_FAIL |
1000 |
Failed |
Configures the read data mode of the input device. If this function is not called, it will be configured to the ‘always receive data’ mode. It can only be used in the input device.
[Syntax]
long setReadMode(int mode);
[Parameters]
int mode: Configure the read data mode. The constants defined below must be used.
Code |
Value |
Description |
MPOS_READMODE_ALWAYS |
0 |
Always receive data (default value) |
MPOS_READMODE_ONCE |
1 |
Receive data only once |
MPOS_READMODE_NONE |
2 |
Do not receive data |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
12) convertHID(int newDeviceType)
You can use the HID device by changing it to a different input device.
[Syntax]
long convertHID(int newDeviceType);
[Parameters]
int newDeviceType: The device type to change the HID device into the constant values of device types that can be used are as follows.
Code |
Value |
Description |
MPOS_DEVICE_LABEL_PRINTER |
1 |
Label Printer |
MPOS_DEVICE_PRINTER |
10 |
POS Printer |
MPOS_DEVICE_MSR |
30 |
MSR |
MPOS_DEVICE_SCANNER |
40 |
Barcode Scanner |
MPOS_DEVICE_RFID |
60 |
RFID |
MPOS_DEVICE_DALLAS_KEY |
70 |
Dallas Key |
MPOS_DEVICE_NFC |
80 |
NFC |
MPOS_DEVICE_DISPLAY |
110 |
Customer Display |
MPOS_DEVICE_USB_TO_SERIAL |
120 |
USB-to-Serial |
MPOS_DEVICE_SCALE |
130 |
Scale |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NO_OPEN |
1002 |
Device cannot be used |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Changes the status value of the current SDK.
[Syntax]
long getResult(void);
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
There are currently no errors |
MPOS_FAIL_NO_OPEN |
1002 |
Failed |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL_NO_RESPONSE |
1005 |
No response |
MPOS_FAIL_NOT_CONNECT |
1006 |
B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to B-gate |
MPOS_FAIL_NO_FILE |
1008 |
There is no file |
MPOS_FAIL_OPENED |
1010 |
Invalid parameter |
MPOS_PAGEMODE_ALREADY_IN |
1014 |
Already in pagemode |
MPOS_TRANSACTION_ALREADY_IN |
1015 |
Already in transation mode |
MPOS_FAIL_2D_BARCODE |
1016 |
Symbology is a 2-D barcode |
MPOS_FAIL_NOT_SUPPORT_ESCSEQ |
1017 |
An unsupported ESC Sequence has been included |
mPOS Controller Printer
1 OverviewMPosControllerPrinter Class provides functions regarding Thermal Printer out of the devices connected to B-gate.
Caution |
- Dot printers must use the MPosControllerDotPrinter Class. - Label printers must use the MPosControllerLabelPrinter Class. |
2 Events
Printer statuses can be received through events. The values defined for each status are as follows.
Code |
Value |
Description |
MPOS_STATUS_NORMAL |
0 |
Printing is possible |
MPOS_STATUS_PRINTER_PAPEREMPTY |
1002 |
No paper |
MPOS_STATUS_PRINTER_PAPER_ NEAREND |
1004 |
Insufficient paper |
MPOS_STATUS_PRINTER_COVEROPEN |
1005 |
Cover is open |
MPOS_STATUS_PRINTER_ERROR |
1006 |
Error |
3 Methods
This is a function that prints character strings. The attributes of the character string to be printed can be configured using FontAttribute or ESC Sequence. If using FontAttribute, you cannot use ESC Sequence. If using ESC Sequence, FontAttribute must be configured as ‘NULL’.
[Syntax]
long printText(string data, FontAttribute attr);
[Parameters]
string data: Character string to be printed
FontAttribute attr: Attributes of the character string to be printed
FontAttribute is an object that can define font attributes.
The defined types according to SDK are as follows.
SDK type |
FontAttribute object type |
iOS SDK |
struct |
Android SDK |
Class |
Windows SDK |
struct |
Properties that can be configured as FontAttribute are as follows.
Attribute name |
Value type |
Attribute Description |
fontType |
int |
Configures font type |
fontSize |
int |
Configures font size as scale unit |
bold |
boolean |
Configures font as bold |
underline |
boolean |
Configures font as underlined |
reverse |
boolean |
Configures font as reversed |
alignment |
int |
Alignment value of character string to be printed |
textEncoding |
int |
Value to be used when Encoding the character string to be printed |
Character string attributes that can be configured in FontAttribute can be substituted by ESC Sequence. Please refer to [ESC Sequence] for details on ESC Sequence.
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
MPOS_FAIL_NOT_SUPPORT_ESCSEQ |
1017 |
Unsupported ESC Sequence is included |
ESC Sequences
These are commands that begin with the characters ESC(0x1B) + ‘|’(0x7C).
Out of the commands below, “#” represents a decimal number value, and a range value exists for each command. “[]” indicates commands that can be omitted. If a number value is omitted, it will become “0”. “!” is a command that cancels the relevant configuration.
An ESC Sequence command that is unsupported by the printer will be ignored.
Escape Sequence |
Supported or unsupported, and configuration value range |
Description |
[#]P |
O (# : 0~100) |
Cutting |
[#]fP |
O (# : 0~100) |
Cutting after feed |
[#]lF |
O (# : 0~50) |
Line feeding as much as # number |
#fT |
O (# : 0~3) |
Configures font types according to # value 0: Default font (A), 1 = Font B, 2 = Font C |
[!]bC |
O |
Bold |
[!][#]uC |
O (# : 1~2) |
Underline |
[!]rvC |
O |
Reverse |
1C |
O |
Font size 1 times width, 1 times height |
2C |
O |
Font size 2 times width, 1 times height |
3C |
O |
Font size 1 times width, 2 times height |
4C |
O |
Font size 2 times width, 2 times height |
#hC |
O |
# times font width proportion |
#vC |
O |
# times font height proportion |
cA |
O |
Align center |
rA |
O |
Align right |
lA |
O |
Align left |
N |
O |
Initialize value that is configurable as ESC Sequence Font type A, font size 1 times width, 1 times height Cancel bold, cancel underline, cancel reverse |
This is the value used when Encoding character strings within SDK.
If you enter a character string that does not exist in the Codepage that corresponds to the Encoding value, incorrect characters such as “?” may be printed in accordance with the default settings of the OS. To change the printer’s codepage settings, you must call the setCharacterset function.
[Syntax]
long setTextEncoding(int textEncoding);
[Parameters]
int textEncoding: The codepage value used when Encoding a character string
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
The Function has been succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to B-gate |
MPOS_FAIL |
1000 |
Failed |
Configures the printer’s codepage. The appropriate codepage value must be used in each printer. If the printer’s codepage has already been configured with the printer configuration utility, this function does not need to be used.
[Syntax]
long setCharacterset(int characterset);
[Parameters]
int characterset: The printer’s codepage value
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to B-gate |
MPOS_FAIL |
1000 |
Failed |
4) setInternationalCharacterset
Configures the printer’s international characterset.
[Syntax]
long setInternationalCharacterset(int internationalCharset);
[Parameters]
int internationalCharset: The printer’s international characterset value
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL |
1000 |
Failed |
Cuts the paper.
[Syntax]
long cutPaper(int cutType);
[Parameters]
int cutType: Cutting type. The defined constant values are listed below.
Code |
Value |
Description |
MPOS_PRINTER_CUTPAPER |
1 |
Cut in place |
MPOS_PRINTER_FEEDCUT |
65 |
Cut after feeding |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Configures pagemode or cancels it after printing.
Caution |
- Pagemode cannot be used simultaneously with transaction mode. - Printing with pagemode will guarantee data integrity in a multi-host environment. |
[Syntax]
long setPagemode (int mode);
[Parameters]
int mode: Configure pagemode. The defined constant values are listed below.
Code |
Value |
Description |
MPOS_PRINTER_PAGEMODE_IN |
1 |
Enter Pagemode |
MPOS_PRINTER_PAGEMODE_OUT |
0 |
Cancel Pagemode after printing |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_PAGEMODE_ALREADY_IN |
1014 |
Already in pagemode |
MPOS_FAIL |
1000 |
Failed |
Configures the printing area of pagemode.
[Syntax]
long setPagemodePrintArea(int x, int y, int width, int height);
[Parameters]
int x: The starting x value of the pagemode printing area
int y: The starting y value of the pagemode printing area
int width: Width value of pagemode printing area
int height: Height value of pagemode printing area
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Configures the printing direction in pagemode.
[Syntax]
long setPagemodeDirection(int direction);
[Parameters]
int direction: Printing direction
Code |
Value |
Description |
MPOS_PRINTER_PD_0 |
0 |
0 degree turn |
MPOS_PRINTER_PD_LEFT90 |
1 |
90 degree turn counter-clockwise |
MPOS_PRINTER_PD_180 |
2 |
180 degree turn |
MPOS_PRINTER_PD_RIGHT90 |
3 |
90 degree turn clockwise |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Configures the coordinates of the printing target in pagemode.
[Syntax]
long setPagemodePosition(int x, int y);
[Parameters]
int x: x axis coordinate value of object to be printed
int y: y axis coordinate value of object to be printed
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Prints an image file.
[Syntax]
long printBitmapFile(string filename, long width, long alignment, long brightness,
boolean isDithering, boolean isCompress);
[Parameters]
string filename: The path of the image file to be printed
long width: The width of the printed image. Use a value larger than 0 or a constant value below.
Code |
Value |
Description |
MPOS_IMAGE_WIDTH_ASIS |
-2 |
Print as original image size |
long alignment: Alignment.
Code |
Value |
Description |
MPOS_ALIGNMENT_LEFT |
0 |
Align to the left |
MPOS_ALIGNMENT_CENTER |
1 |
Align at the center |
MPOS_ALIGNMENT_RIGHT |
2 |
Align to the right |
long brightness: The brightness of the image when printing. Can use a number between 0 and 100
boolean isDithering: Whether or not to apply dithering when printing image
boolean isCompress: Whether or not to compress when sending data
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL_NO_FILE |
1000 |
There is no file |
MPOS_FAIL |
1000 |
Failed |
Prints an image data. Windows SDK does not support this.
[Syntax]
long printBitmapFile(ImageData data, long width, long alignment, long brightness,
boolean isDithering, boolean isCompress);
[Parameters]
ImageData data: The image data to be printed
long width: The width of the printed image. Use a value larger than 0 or a constant value below.
Code |
Value |
Description |
MPOS_IMAGE_WIDTH_ASIS |
-2 |
Print as original image size |
long alignment: Alignment. You must use a constant defined below.
Code |
Value |
Description |
MPOS_ALIGNMENT_LEFT |
0 |
Align to the left |
MPOS_ALIGNMENT_CENTER |
1 |
Align at the center |
MPOS_ALIGNMENT_RIGHT |
2 |
Align to the right |
long brightness: Image brightness. Can use a number between 0 and 100
boolean isDithering: Whether or not to apply dithering when printing image
boolean isCompress: Whether or not to compress when sending data
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Prints a 1-D barcode.
[Syntax]
long print1DBarcode(string data, int symbology, int height, int barWidth, int alignment, int textPosition);
[Parameters]
string data: Data of the barcode to be printed
int symbology: The type of 1-D barcode. You must use a constant defined below.
Code |
Value |
Description |
MPOS_BARCODE_UPCA |
101 |
UPC A barcode |
MPOS_BARCODE_UPCE |
102 |
UPC E barcode |
MPOS_BARCODE_EAN8 MPOS_BARCODE_JAN8 |
103 |
EAN 8/JAN 8 barcode |
MPOS_BARCODE_EAN13 MPOS_BARCODE_JAN13 |
104 |
EAN 13/JAN 13 barcode |
MPOS_BARCODE_ITF |
106 |
ITF barcode |
MPOS_BARCODE_CODABAR |
107 |
CODABAR barcode |
MPOS_BARCODE_CODE39 |
108 |
CODE39 barcode |
MPOS_BARCODE_CODE93 |
109 |
CODE93 barcode |
MPOS_BARCODE_CODE128 |
110 |
CODE128 barcode |
int height: Barcode height. Can use a number between 1 and 255
int barWidth: Width of barcode bars. Can use a number between 2 and 8 (default value: 2)
int alignment: Alignment value. You must use a constant defined below.
Code |
Value |
Description |
MPOS_ALIGNMENT_LEFT |
0 |
Align left |
MPOS_ALIGNMENT_CENTER |
1 |
Align center |
MPOS_ALIGNMENT_RIGHT |
2 |
Align right |
int textPosition: The printing position of the HRI (Human Readable Interface). You must use a constant defined below.
Code |
Value |
Description |
MPOS_BARCODE_TEXTNONE |
0 |
Does not print |
MPOS_BARCODE_TEXTABOVE |
1 |
Print above barcode |
MPOS_BARCODE_TEXTBELOW |
2 |
Print below barcode |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL_2D_BARCODE |
1016 |
Symbology is a 2-D barcode |
MPOS_FAIL |
1000 |
Failed |
Prints the QR Code.
[Syntax]
long printQRCode (string data, int model, int alignment, int moduleSize, int eccLevel);
[Parameters]
string data: The QR Code data to be printed
int model: The model type of the QR Code. You must use a constant defined below.
Code |
Value |
Description |
MPOS_BARCODE_QRCODE_MODEL1 |
204 |
MODEL 1 |
MPOS_BARCODE_QRCODE_MODEL2 |
205 |
MODEL 2 |
int alignment: Alignment value. You must use a constant defined below.
Code |
Value |
Description |
MPOS_ALIGNMENT_LEFT |
0 |
Align left |
MPOS_ALIGNMENT_CENTER |
1 |
Align center |
MPOS_ALIGNMENT_RIGHT |
2 |
Align right |
int moduleSize: The module size of the QR Code. Can use a number between 1 and 8 (default value: 3)
int eccLevel: Error correction level. You must use a constant defined below.
Code |
Value |
Description |
MPOS_QRCODE_ECC_LEVEL_L |
48 |
Error correction 10% |
MPOS_QRCODE_ECC_LEVEL_M |
49 |
Error correction 10% |
MPOS_QRCODE_ECC_LEVEL_Q |
50 |
Error correction 10% |
MPOS_QRCODE_ECC_LEVEL_H |
51 |
Error correction 10% |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Prints the PDF417 barcode.
[Syntax]
long printPDF417(string data, int symbol, int alignment, int columnNumber, int rowNumber,
int moduleWidth, int moduleHeight, int eccLevel);
[Parameters]
string data: The PDF417 barcode to be printed
int symbol: The type of the PDF417 barcode. You must use a constant defined below.
Code |
Value |
Description |
MPOS_BARCODE_PDF417 |
201 |
PDF417 Standard |
MPOS_BARCODE_PDF417_SIMPLIFIED |
202 |
PDF417 Simplified |
int alignment: Alignment value. You must use a constant defined below.
Code |
Value |
Description |
MPOS_ALIGNMENT_LEFT |
0 |
Align left |
MPOS_ALIGNMENT_CENTER |
1 |
Align center |
MPOS_ALIGNMENT_RIGHT |
2 |
Align right |
int columnNumber: The number of barcode Columns. Can use a number between 0 and 30 (0 is the automatic setting)
int rowNumber: The number of barcode rows. Can use a number between 3 and 90 (0 is the automatic setting)
int moduleWidth: The width of the module. Can use a number between 1 and 4
int moduleHeight: The height of the module. Can use a number between 2 and 8
int eccLevel: The error correction level. Can use a number between 0 and 8
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Prints the GS1Databar.
[Syntax]
long printGS1Databar(string data, int symbol, int alignment, int moduleSize);
[Parameters]
string data: The GS1Databar data to be printed
int symbol: The type of the GS1Databar barcode. You must use a constant defined below.
Code |
Value |
Description |
MPOS_BARCODE_GS1_RSS14STACKEDOMNIDIRECTIONAL |
133 |
GS1 DataBar Stacked Omnidirectional |
MPOS_BARCODE_GS1_RSS14STACKED |
134 |
GS1 DataBar Stacked |
int alignment: Alignment value. You must use a constant defined below.
Code |
Value |
Description |
MPOS_ALIGNMENT_LEFT |
0 |
Align left |
MPOS_ALIGNMENT_CENTER |
1 |
Align center |
MPOS_ALIGNMENT_RIGHT |
2 |
Align right |
int moduleSize: The size of the module. Can use a number between 1 and 8
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Prints the DataMatrix.
[Syntax]
long printDataMatrix(string data, int alignment, int moduleSize);
[Parameters]
string data: The DataMatrix’s data to be printed
int alignment: Alignment value. You must use a constant defined below.
Code |
Value |
Description |
MPOS_ALIGNMENT_LEFT |
0 |
Align left |
MPOS_ALIGNMENT_CENTER |
1 |
Align center |
MPOS_ALIGNMENT_RIGHT |
2 |
Align right |
int moduleSize: The size of the module. Can use 2 or 3
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Checks the printer’s status.
[Syntax]
long checkPrinterStatus(void);
[Return Values]
Code |
Value |
Description |
MPOS_STATUS_NORMAL |
0 |
Printing is possible |
MPOS_STATUS_PRINTER_COVEROPEN |
1006 |
Cover is open |
MPOS_STATUS_PRINTER_PAPEREMPTY |
1007 |
No paper |
MPOS_STATUS_PRINTER_PAPER_NEAREND |
1004 |
Insufficient paper |
MPOS_STATUS_PRINTER_ERROR |
1000 |
Error |
Configures the Automatic Status Back function. If the printer’s status changes while using this function, the printer’s new status will be sent to the application through StatusUpdateEvent.
[Syntax]
long asbEnable(boolean enable);
[Parameters]
boolean enable: Determines whether or not to configure
If the printer status changes while this is set to true, the printer’s status will be sent through StatusUpdateEvent.
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Opens the CashDrawer that is connected to the printer.
[Syntax]
long openDrawer(int pinNumber);
[Parameters]
int pinNumber: The PIN of the Cashdrawer. You must use a constant defined below.
Code |
Value |
Description |
MPOS_CASHDRAWER_PIN2 |
0 |
The Cashdrawer’s PIN is 2 |
MPOS_CASHDRAWER_PIN5 |
1 |
The Cashdrawer’s PIN is 5 |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
mPOS Controller Dot Printer
1 OverviewMPosControllerDotPrinter Class provides functions regarding DotPrinter out of the devices connected to the B-gate. The action of a function is identical to MPosControllerPrinter Class.
2 Events
Please refer to the details in 6-3-3-2 MPosControllerPrinter Reference - 2 Events.
3 Methods
Please refer to 6-3-3-2 MPosControllerPrinter Reference - 3 Methods for the details of each function.
Supported methods list
Function names |
printText |
setTextEncoding |
setCharacterset |
setInternationalCharacterset |
cutPaper |
setTransaction |
printBitmapFile |
printBitmap |
checkPrinterStatus |
asbEnable |
openDrawer |
mPOS Controller MSR
1 OverviewMPosControllerMSR Class provides functions regarding MSR devices out of those connected to B-gate.
2 Events
A device’s data can be received through DataEvent.
mPOS Controller Scanner
1 OverviewMPosControllerScanner Class provides functions regarding Barcode Scanner out of the devices connected to the B-gate.
2 Events
A device’s data can be received through DataEvent.
mPOS Controller HID
1 Overview• MPosControllerHID Class provides functions regarding HID devices out of those connected to the B-gate.
2 Events
A device’s data can be received through DataEvent.
mPOS Controller BCD
1 OverviewMPosControllerBCD Class provides functions regarding Customer Display out of the devices connected to the B-gate.
Caution |
If connecting BCD-2000/3000 directly to the Host, the selectCommandMode function must be called. |
2 Events
A device’s data can be received through DataEvent
Displays the character string on Customer Display. The previously displayed data will be deleted.
[Syntax]
long displayString(string data);
[Parameters]
string data: The data to be displayed on Customer Display
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Displays a character string in a specific line of Customer Display. The previously displayed data will be deleted. If the length of the entered data exceeds 1 line, the displayed result will change according to the configuration of Customer Display. Only the Bixolon Customer Display is supported.
[Syntax]
long displayStringAtLine(int line, string data);
[Parameters]
int line: The line that will display the character string. Starts from 1
string data: The character string to be displayed
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Deletes the screen’s contents. The cursor will appear on the first row of the first line.
[Syntax]
long clearScreen();
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL |
1000 |
Failed |
This is the value used when Encoding a character string within SDK.
If you enter a character string that does not exist in the codepage that corresponds to the Encoding value, incorrect characters such as “?” may be printed in accordance with the default settings of the OS. To change the codepage settings of Customer Display, you must call the setCharacterset function.
[Syntax]
long setTextEncoding(int textEncoding);
[Parameters]
int textEncoding: The codepage value used when Encoding a character string.
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL |
1000 |
Failed |
Configures the codepage of Customer Display. The appropriate codepage value must be used in each Customer Display. If the codepage has already been configured with the Customer Display configuration utility, this function does not need to be used.
[Syntax]
long setCharacterset(int characterset);
[Parameters]
int characterset: The codepage value of Customer Display.
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL |
1000 |
Failed |
6) setInternationalCharacterset
Configures the international characterset of Customer Display.
[Syntax]
long setInternationalCharacterset(int internationalCharset);
[Parameters]
int internationalCharset: The international characterset value of Customer Display.
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to B-gate |
MPOS_FAIL |
1000 |
Failed |
Saves the image data of Customer Display.
Only supported by BIXOLON Customer Displays. Windows SDK does not support this.
[Syntax]
long storeImage(ImageData data, int width, int imageNumber);
[Parameters]
ImageData data: Image data to be saved
int width: Image width
int imageNumber: Number that will save an image. Can use a number between 1 and 5
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL |
1000 |
Failed |
Customer Display saves an image file. Only supported by BIXOLON Customer Displays.
[Syntax]
long storeImageFile(string filename, int width, int imageNumber);
[Parameters]
string filename: File path of image to be saved
int width: Image width
int imageNumber: Number that will save an image. Can use a number between 1 and 5
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to B-gate |
MPOS_FAIL |
1000 |
Failed |
Displays a saved image on Customer Display.
[Syntax]
long displayImage(int imageNumber, int xPos, int yPos);
[Parameters]
int imageNumber: Image number to be displayed
int xPos: x axis coordinates of the top left of the image
int yPos: y axis coordinates of the top left of the image
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to B-gate |
MPOS_FAIL |
1000 |
Failed |
Deleted the imaged saved in Customer Display and deletes the image displayed on the screen. Only supported by BIXOLON Customer Displays.
[Syntax]
long clearImage(boolean isAll, int imageNumber);
[Parameters]
boolean isAll: Determines whether or not to delete all saved images
If true, all saved images will be deleted regardless of imageNumber
This must be configured to false if you wish to only delete an image of a specific number.
int imageNumber: Deletes the image saved to the imageNumber value.
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL |
1000 |
Failed |
mPOS Controller TTYUSB
1 OverviewMPosControllerTTYUSB Class provides functions regarding USB-to-Serial devices out of those connected to the B-gate.
2 Events
• A device’s data can be received through DataEvent
mPOS Controller Label Printer
1 OverviewMPosControllerLabelPrinter Class provides functions regarding label printers out of the
devices connected to the B-gate. The LabelPrinter must call the printBuffer function for
the actual printing to work.
2 Events
A device’s status can be received through StatusUpdateEvent.
Code |
Value |
Description |
MPOS_LABEL_STATUS_IDLE |
0 |
Printing is possible |
MPOS_LABEL_STATUS_PRINTER_PAPEREMPTY |
1 |
No paper |
MPOS_LABEL_STATUS_PRINTER_COVEROPEN |
2 |
Cover is open |
MPOS_LABEL_STATUS_PRINTER_CUTTER_JAMMED |
3 |
Cutter error |
MPOS_LABEL_STATUS_PRINTER_TPH_OVERHEAT |
4 |
TPH overheating |
MPOS_LABEL_STATUS_PRINTER_GAP_ERROR |
5 |
GAP sensor error |
MPOS_LABEL_STATUS_PRINTER_RIBBON_END |
6 |
No ribbon |
MPOS_LABEL_STATUS_PRINTER_ON_BUILDING_LABEL_TO_BE_PRINTED |
7 |
Building label buffer |
MPOS_LABEL_STATUS_PRINTER_ON_PRINTING_LABEL |
8 |
Printing |
MPOS_LABEL_STATUS_PRINTER_ISSUED_LABEL_ISPAUSED |
9 |
Paper stuck to filler |
3 Methods
• This is the value used when Encoding character strings within SDK.
If you enter a character string that does not exist in the Codepage that corresponds to the Encoding value, incorrect characters such as “?” may be printed in accordance with the default settings of the OS. To change the label printer’s codepage settings, you must call the setCharacterset function.
[Syntax]
long setTextEncoding(int textEncoding);
[Parameters]
int textEncoding: The codepage value used when encoding a character string
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_OPENED |
1010 |
Called after openService function |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Changes the label printer’s codepage and International characterset.
[Syntax]
long setCharacterset(int characterset, int internationalCharset);
[Parameters]
int characterset: The codepage value of the label printer
int internationalCharset: The International Characterset value of the label printer
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_OPENED |
1010 |
Called after openService function |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Returns the status value of the current label printer.
[Syntax]
long checkPrinterStatus(void);
[Return Values]
Code |
Value |
Description |
MPOS_LABEL_STATUS_IDLE |
0 |
Printing is possible |
MPOS_LABEL_STATUS_PRINTER_PAPEREMPTY |
1 |
No paper |
MPOS_LABEL_STATUS_PRINTER_COVEROPEN |
2 |
Cover is open |
MPOS_LABEL_STATUS_PRINTER_CUTTER_JAMMED |
3 |
Cutter error |
MPOS_LABEL_STATUS_PRINTER_TPH_OVERHEAT |
4 |
TPH overheating |
MPOS_LABEL_STATUS_PRINTER_GAP_ERROR |
5 |
GAP sensor error |
MPOS_LABEL_STATUS_PRINTER_RIBBON_END |
6 |
No ribbon |
MPOS_LABEL_STATUS_PRINTER_ON_BUILDING_LABEL_TO_BE_PRINTED |
7 |
Building label buffer |
MPOS_LABEL_STATUS_PRINTER_ON_PRINTING_LABEL |
8 |
Printing |
MPOS_LABEL_STATUS_PRINTER_ISSUED_LABEL_ISPAUSED |
9 |
Paper stuck to filler |
Prints the label printer buffer.
[Syntax]
long printBuffer(int numberOfCopies);
[Parameters]
int numberOfCopies: Number of prints. Can use from 1
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Sends data to the label printer.
[Syntax]
long printRawData(Datatype rawData);
[Parameters]
Datatype rawData: Data to be sent
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL |
1000 |
Failed |
Saves a character string to the label printer buffer using Device font.
[Syntax]
long drawTextDeviceFont(String data, int xPos, int yPos, char fontSelection, int fontWidth, int fontHeight, int rightSpace, int rotation, boolean reverse, boolean bold, boolean rightToLeft, int alignment);
[Parameters]
String data: Character string to be printed.
int xPos: x axis coordinates of the character string to be printed
int yPos: y axis coordinates of the character string to be printed
char fontSelection: Font configuration. You must use a constant defined below.
Code |
Value |
Description |
MPOS_LABEL_DEVICE_FONT_6PT |
‘0’ |
9 X 15 (dots) |
MPOS_LABEL_DEVICE_FONT_8PT |
‘1’ |
12 X 20 (dots) |
MPOS_LABEL_DEVICE_FONT_10PT |
‘2’ |
16 X 25 (dots) |
MPOS_LABEL_DEVICE_FONT_12PT |
‘3’ |
19 X 30 (dots) |
MPOS_LABEL_DEVICE_FONT_15PT |
‘4’ |
24 X 38 (dots) |
MPOS_LABEL_DEVICE_FONT_20PT |
‘5’ |
32 X 40 (dots) |
MPOS_LABEL_DEVICE_FONT_30PT |
‘6’ |
48 X 76 (dots) |
MPOS_LABEL_DEVICE_FONT_14PT |
‘7’ |
22 X 34 (dots) |
MPOS_LABEL_DEVICE_FONT_18PT |
‘8’ |
28 X 44 (dots) |
MPOS_LABEL_DEVICE_FONT_24PT |
‘9’ |
37 X 58 (dots) |
MPOS_LABEL_DEVICE_FONT_KOREAN1 |
‘a’ |
16 X 16 (dots) (English. Numbers 9 X 15) |
MPOS_LABEL_DEVICE_FONT_KOREAN2 |
‘b’ |
24 X 24 (dots) (English. Numbers 12 X 24) |
MPOS_LABEL_DEVICE_FONT_KOREAN3 |
‘c’ |
20 X 20 (dots) (English. Numbers 12 X 20) |
MPOS_LABEL_DEVICE_FONT_KOREAN4 |
‘d’ |
26 X 26 (dots) (English. Numbers 16 X 30) |
MPOS_LABEL_DEVICE_FONT_KOREAN5 |
‘e’ |
20 X 26 (dots) (English. Numbers 16 X 30) |
MPOS_LABEL_DEVICE_FONT_KOREAN6 |
‘f’ |
38 X 38 (dots) (English. Numbers 22 X 34) |
MPOS_LABEL_DEVICE_FONT_GB2312 |
‘m’ |
24 X 24 (dots) (English. Numbers 12 X 24) |
MPOS_LABEL_DEVICE_FONT_BIG5 |
‘n’ |
24 X 24 (dots) (English. Numbers 12 X 24) |
MPOS_LABEL_DEVICE_FONT_SHIFT_JIS |
‘j’ |
24 X 24 (dots) (English. Numbers 12 X 24) |
int fontWidth: Configures the width expansion ratio of a character. Can use a number between 1 and 4
int fontHeight: Configures the height expansion ratio of a character. Can use a number between 1 and 4
int rightSpace: Configures the space on the right of a character (default value: 0)
int rotation: The printing direction of a character string
Code |
Value |
Description |
MPOS_LABEL_ROTATION_DEGREES_0 |
0 |
0 degree turn |
MPOS_LABEL_ROTATION_DEGREES_90 |
1 |
90 degree turn clockwise |
MPOS_LABEL_ROTATION_DEGREES_180 |
2 |
180 degree turn |
MPOS_LABEL_ROTATION_DEGREES_270 |
3 |
270 degree turn clockwise |
boolean reverse: Sets to reverse
boolean bold: Sets to bold
boolean rightToLeft: Changes the order of the character string from right to left
Alignment will not be applied if the rightToLeft is configured to true.
int alignment: Alignment value when printing character string
Code |
Value |
Description |
MPOS_LABEL_ALIGNMENT_LEFT |
0 |
Align left |
MPOS_LABEL_ALIGNMENT_RIGHT |
1 |
Align right |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Saves character strings to the label printer buffer using Vector font.
[Syntax]
long drawTextVectorFont (String data, int xPos, int yPos, char fontSelection, int fontWidth, int fontHeight, int rightSpace, int rotation, boolean reverse, boolean bold, boolean italic, boolean rightToLeft, int alignment)
[Parameters]
String data: Character string to be printed
int xPos: x axis coordinates of character string to be printed
int yPos: y axis coordinates of character string to be printed
char fontSelection: Font configuration. Configurable values are listed below.
Code |
Value |
Description |
MPOS_LABEL_VECTOR_FONT_ASCII |
‘U’ |
Ascii (1Byte code) |
MPOS_LABEL_VECTOR_FONT_KS5601 |
‘K’ |
KS5601 (2Byte code) |
MPOS_LABEL_VECTOR_FONT_BIG5 |
‘B’ |
BG5 (2Byte code) |
MPOS_LABEL_VECTOR_FONT_GB2312 |
‘G’ |
GB2312 (2Byte code) |
MPOS_LABEL_VECTOR_FONT_SHIFT_JIS |
‘J’ |
Shift-JIS (2Byte code) |
MPOS_LABEL_VECTOR_FONT_OCR_A |
‘a’ |
OCR-A (1Byte code) |
MPOS_LABEL_VECTOR_FONT_OCR_B |
‘b’ |
OCR-B (1Byte code) |
int fontWidth: Configures width size of character
int fontHeight: Configures height size of character
int rightSpace: Configures right space of character
int rotation: Configures character string printing direction
Code |
Value |
Description |
MPOS_LABEL_ROTATION_DEGREES_0 |
0 |
0 degree turn |
MPOS_LABEL_ROTATION_DEGREES_90 |
1 |
90 degree turn clockwise |
MPOS_LABEL_ROTATION_DEGREES_180 |
2 |
180 degree turn |
MPOS_LABEL_ROTATION_DEGREES_270 |
3 |
270 degree turn clockwise |
boolean reverse: Sets to reverse
boolean bold: Sets font as bold
boolean italic: Sets to italic
boolean rightToLeft: Changes the order of the character string from right to left
Alignment will not be applied if the rightToLeft is configured to true.
int alignment: Alignment value when printing character string
Code |
Value |
Description |
MPOS_LABEL_ALIGNMENT_LEFT |
0 |
Align left |
MPOS_LABEL_ALIGNMENT_RIGHT |
1 |
Align right |
MPOS_LABEL_ALIGNMENT_CENTER |
2 |
Align center |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Saves a 1-D barcode to the label printer buffer.
[Syntax]
long drawBarcode1D(String data, int xPos, int yPos, int barcodeType, int widthNarrow, int widthWide, int height, int hri, int quietZoneWidth, int rotation)
[Parameters]
String data: Data of the barcode to be printed
int xPos: x axis coordinates of barcode to be printed
int yPos: y axis coordinates of barcode to be printed
int barcodeType: Type of barcode to be printed
int widthNarrow: Narrow bar width.
int widthWide: Wide bar width
int height: Barcode height
int hri: HRI (Human Readable Interface) printing position.
You must use a constant defined below.
Code |
Value |
Description |
MPOS_BARCODE_TEXTNONE |
0 |
Does not print |
MPOS_BARCODE_TEXTABOVE |
1 |
Print above barcode |
MPOS_BARCODE_TEXTBELOW |
2 |
Print below barcode |
MPOS_BARCODE_TEXTABOVE_FONTSIZE2 |
3 |
Print above barcode (font size 2) |
MPOS_BARCODE_TEXTBELOW_FONTSIZE2 |
4 |
Print below barcode (font size 2) |
MPOS_BARCODE_TEXTABOVE_FONTSIZE3 |
5 |
Print above barcode (font size 3) |
MPOS_BARCODE_TEXTBELOW_FONTSIZE3 |
6 |
Print below barcode (font size 3) |
MPOS_BARCODE_TEXTABOVE_FONTSIZE4 |
7 |
Print above barcode (font size 4) |
MPOS_BARCODE_TEXTBELOW_FONTSIZE4 |
8 |
Print below barcode (font size 4) |
int quietZoneWidth: Configures Quiet zone. Can use a number between 0 and 20
int rotation: Printing direction of barcode to be printed
Code |
Value |
Description |
MPOS_LABEL_ROTATION_DEGREES_0 |
0 |
0 degree turn |
MPOS_LABEL_ROTATION_DEGREES_90 |
1 |
90 degree turn clockwise |
MPOS_LABEL_ROTATION_DEGREES_180 |
2 |
180 degree turn |
MPOS_LABEL_ROTATION_DEGREES_270 |
3 |
270 degree turn clockwise |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
1006 |
The B-gate has failed to connect |
MPOS_FAIL_NO_DEVICE |
1007 |
No device connected to the B-gate |
MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameter |
MPOS_FAIL |
1000 |
Failed |
Saves MaxiCode to the label printer buffer.
[Syntax]
long drawBarcodeMaxiCode(String data, int xPos, int yPos, int mode)
[Parameters]
String data: Data of the barcode to be printed
int xPos: x axis coordinates of barcode to be printed
int yPos: y axis coordinates of barcode to be printed
int mode: Maxicode mode configuration. You must use a constant defined below.
Code |
Value |
Description |
MPOS_LABEL_MAXICODE_MODE_0 |
0 |
MaxiCode Mode is configured to 0 |
MPOS_LABEL_MAXICODE_MODE_2 |
2 |
MaxiCode Mode is configured to 2 |
MPOS_LABEL_MAXICODE_MODE_3 |
3 |
MaxiCode Mode is configured to 3 |
MPOS_LABEL_MAXICODE_MODE_4 |
4 |
MaxiCode Mode is configured to 4 |
[Return Values]
Code |
Value |
Description |
MPOS_SUCCESS |
0 |
Function has succeeded |
MPOS_FAIL_NOT_CONNECT |
|