Select your printer model
addBarcode
Adds a barcode print command to the command buffer.
Syntax
- (int) addBarcode:(NSString *)data type:(int)type hri:(int)hri font:(int)font width:(long)width height:(long)height; |
Parameter
data
Specifies barcode data as a text string.
Specify a string in accordance with the standard of the barcode specified in type.
Type |
Description |
---|---|
UPC-A |
If an 11-digit figure is specified, the check digit is automatically appended. |
UPC-E |
Specify 0 in the first digit. |
EAN13 |
If an 12-digit figure is specified, the check digit is automatically appended. |
JAN13 |
|
EAN8 |
If an 7-digit figure is specified, the check digit is automatically appended. If an 8-digit figure is specified, the 8th digit is used as the check digit but verification is not performed. |
JAN8 |
|
CODE39 |
If the first character is * , this character is processed as the start character. |
ITF |
The start and stop codes are automatically added. |
CODABAR |
Specify the start character ((A to D, a to d). |
CODE93 |
The start and stop characters are automatically added. |
CODE128 |
Specify the start character (CODE A, CODE B, CODE C).
When specifying CODE C, specify the barcode data as the control code of the escape sequence. |
CODE128 auto |
The start character, check digit, and stop character are automatically added. The character string added to make the overall width of the CODE128 symbol as mini-mum is automatically converted. In this function, there is no need to specify the code set, and the barcode is printed simply by entering the data to be converted to symbols. Example) When entering numbers: "123", etc. When entering alphabets: "ABCabc", etc. Data from 0 to 255 (control codes and character codes) can be specified. Since the overall width changes automatically, use this function after confirming that the barcode fits into the print area and is printed without any problem. When using FNC1, etc., use CODE128 rather than CODE128 auto. |
GS1-128 |
The start character, FNC1, check digit, and stop characters are automatically added.
However, FNC1 used as a data separator is not added.
|
GS1 DataBar Omnidirectional |
Specify a 13-digit product ID (GTIN) excluding the application ID (AI) and check digit. |
GS1 DataBar Truncated |
|
GS1 DataBar Limited |
|
GS1 DataBar Expanded |
The application ID (AI) can be put in parentheses.
|
When specifying binary data which cannot be represented as a string, use the following escape sequences.
String |
Description |
---|---|
\xnn |
Control code (set nn in hexadecimal) |
\\ |
Back slash |
type
Specifies the barcode type.
Value |
Description |
---|---|
EPOS2_BARCODE_UPC_A |
UPC-A |
EPOS2_BARCODE_UPC_E |
UPC-E |
EPOS2_BARCODE_EAN13 |
EAN13 |
EPOS2_BARCODE_JAN13 |
JAN13 |
EPOS2_BARCODE_EAN8 |
EAN8 |
EPOS2_BARCODE_JAN8 |
JAN8 |
EPOS2_BARCODE_CODE39 |
CODE39 |
EPOS2_BARCODE_ITF |
ITF |
EPOS2_BARCODE_CODABAR |
CODABAR |
EPOS2_BARCODE_CODE93 |
CODE93 |
EPOS2_BARCODE_CODE128 |
CODE128 |
EPOS2_BARCODE_CODE128_AUTO |
CODE128_AUTO |
EPOS2_BARCODE_GS1_128 |
GS1-128 |
EPOS2_BARCODE_GS1_DATABAR_OMNIDIRECTIONAL |
GS1 DataBar Omnidirectional |
EPOS2_BARCODE_GS1_DATABAR_TRUNCATED |
GS1 DataBar Truncated |
EPOS2_BARCODE_GS1_DATABAR_LIMITED |
GS1 DataBar Limited |
EPOS2_BARCODE_GS1_DATABAR_EXPANDED |
GS1 DataBar Expanded |
hri
Specifies the HRI position.
Value |
Description |
---|---|
EPOS2_HRI_NONE (default) |
No printing. |
EPOS2_HRI_ABOVE |
Above the barcode |
EPOS2_HRI_BELOW |
Below the barcode |
EPOS2_HRI_BOTH |
Both above and below the barcode |
EPOS2_PARAM_DEFAULT |
Specifies the default value (no printing). |
EPOS2_PARAM_UNSPECIFIED |
<Obsolete> Not specify. |
font
Specifies the HRI font.
Value |
Description |
---|---|
EPOS2_FONT_A (default) |
Font A |
EPOS2_FONT_B |
Font B |
EPOS2_FONT_C |
Font C |
EPOS2_FONT_D |
Font D |
EPOS2_FONT_E |
Font E |
EPOS2_PARAM_DEFAULT |
Specifies the default value (font A). |
EPOS2_PARAM_UNSPECIFIED |
<Obsolete> Not specify. |
width
Specifies the width of a single module in dots.
Value |
Description |
---|---|
Integer from 2 to 6 |
Width of a single module (in dots) |
EPOS2_PARAM_UNSPECIFIED |
<Obsolete> Not specify. |
height
Specifies the height of the barcode in dots.
Value |
Description |
---|---|
Integer from 1 to 255 |
Height of the barcode (in dots) |
EPOS2_PARAM_UNSPECIFIED |
<Obsolete> Not specify. |
Return value
Error status |
Description |
---|---|
EPOS2_SUCCESS |
The function was executed successfully. |
EPOS2_ERR_PARAM |
An invalid parameter was passed. |
EPOS2_ERR_MEMORY |
Memory necessary for processing could not be allocated. |
EPOS2_ERR_FAILURE |
An unknown error occurred. |
Supplementary explanation
- Use this API at the "beginning of a line."
- When the barcode data specified in data does not conform to the barcode standard specified in type, an error will not be returned in the return value and the barcode will not be printed.
- The "CODE 128 auto" type of barcode can be specified when the printer is TM-m30II, TM-m30II-H, TM-m30II-NT, TMm30II-S, TM-m30II-SL, TM-m30III, TM-m30III-H, TM-m50, TM-m50II, TM-m50II-H, TM-T88VII, TM-L100, TM-P20II, or TM-P80II.
Quick Access
- [Name]
- [Format]
- [Range]
- [Description]
- [Notes]
- Introduction
- help
- Epos2Printer class
- initWithPrinterSeries
- connect
- disconnect
- startMonitor
- stopMonitor
- getStatus
- sendData
- beginTransaction
- endTransaction
- requestPrintJobStatus
- clearCommandBuffer
- addTextAlign
- addLineSpace
- addTextRotate
- addText
- addTextLang
- addTextFont
- addTextSmooth
- addTextSize
- addTextStyle
- addHPosition
- addFeedUnit
- addFeedLine
- addImage
- addLogo
- addBarcode
- addSymbol
- addHLine
- addVLineBegin
- addVLineEnd
- addPageBegin
- addPageEnd
- addPageArea
- addPageDirection
- addPagePosition
- addPageLine
- addPageRectangle
- addRotateBegin
- addRotateEnd
- addCut
- addPulse
- addSound
- addFeedPosition
- addLayout
- addCommand
- getMaintenanceCounter
- resetMaintenanceCounter
- getPrinterSetting
- setPrinterSetting
- getPrinterSettingEx
- setPrinterSettingEx
- setPrinterSettingEx[Obsolete]
- verifyPassword
- getPrinterInformation
- downloadFirmwareList
- getPrinterFirmwareInfo
- verifyUpdate
- updateFirmware
- forceRecover
- forcePulse
- forceStopSound
- forceCommand
- forceReset
- setStatusChangeEventDelegate
- setReceiveEventDelegate
- setGetPrinterSettingExDelegate
- setSetPrinterSettingExDelegate
- setVerifyPasswordDelegate
- interval
- Epos2LFCPrinter class
- Epos2HybridPrinter class
- initWithLang
- connect
- disconnect
- startMonitor
- stopMonitor
- getStatus
- sendData
- beginTransaction
- endTransaction
- clearCommandBuffer
- selectPaperType
- waitInsertion
- cancelInsertion
- ejectPaper
- readMicrData
- cleanMicrReader
- forceRecover
- forcePulse
- forceCommand
- forceReset
- paperType
- interval
- waitTime
- mode40Cpl
- setStatusChangeEventDelegate
- setReceiveEventDelegate
- Epos2LineDisplay class
- initWithDisplayModel
- connect
- disconnect
- getStatus
- sendData
- clearCommandBuffer
- addInitialize
- addCreateWindow
- addDestroyWindow
- addSetCurrentWindow
- addClearCurrentWindow
- addCreateScreen
- addCreateScreenCustom
- addCreateTextArea
- addDestroyTextArea
- addSetCurrentTextArea
- addClearCurrentTextArea
- addSetCursorPosition
- addMoveCursorPosition
- addSetCursorType
- addText
- addReverseText
- addMarqueeText
- addSetBlink
- addSetBrightness
- addBackgroundColor
- addStartSlideShow
- addStopSlideShow
- addDownloadImage
- addRegisterDownloadImage
- addNVImage
- addClearImage
- addSymbol
- addClearSymbol
- addShowClock
- addCommand
- setReceiveEventDelegate
- Epos2Keyboard class
- Epos2POSKeyboard class
- Epos2BarcodeScanner class
- Epos2MSR class
- Epos2SimpleSerial class
- Epos2GermanyFiscalElement class
- Epos2OtherPeripheral class
- Epos2CommBox class
- Common to all classes
- Epos2Discovery class
- Epos2Log class
- Epos2BluetoothConnection class
- EasySelect class
- EasySelectInfo class
- Appendix
- Status list
- Key code list
- List of Supported Classes
- List of Supported APIs
- Printer-specific Support Information
- TM-m10
- TM-m30
- TM-m30II
- TM-m30II-H
- TM-m30II-NT
- TM-m30II-S
- TM-m30II-SL
- TM-m30III
- TM-m30III-H
- TM-m50
- TM-m50II
- TM-m50II-H
- TM-T20
- TM-T20II
- TM-T20III
- TM-T20IIIL
- TM-T20IV-L
- TM-T20X
- TM-T20X-II
- TM-T60
- TM-T70
- TM-T70II
- TM-T81II
- TM-T81III
- TM-T82
- TM-T82II
- TM-T82III
- TM-T82IIIL
- TM-T82IV-L
- TM-T82X
- TM-T82X-II
- TM-T83III
- TM-T83IV
- TM-T88V
- TM-T88VI
- TM-T88VII
- TM-T100
- TM-L90 Liner-Free Label Printer Model
- TM-L100
- TM-U220
- TM-U330
- TM-P20
- TM-P20II
- TM-P60 (Receipt)
- TM-P60 (Peeler)
- TM-P60II (Receipt)
- TM-P60II (Peeler)
- TM-P80
- TM-P80II
- TM-H6000V
- TM-T20II-i
- TM-T70-i
- TM-T82II-i
- TM-T83II-i
- TM-T88V-i
- TM-T88VI-iHUB
- TM-U220-i
- TM-T70II-DT
- TM-T70II-DT2
- TM-T88V-DT
- TM-T88VI-DT2
- TM-H6000IV-DT
- TM-T88IV
- TM-T90
- TM-L90
- TM-H6000IV
- Usage restriction by firmware version