Select your printer model
addBarcode method
Adds a barcode print command to the command buffer.
Syntax
addBarcode(data, type, hri, font, width, height); |
Parameter
data
String |
Description |
---|---|
String |
Specifies barcode data as a string. |
Use the following escape sequences to specify binary data which cannot be represented as a string:
String |
Description |
---|---|
\xnn |
Control code (set nn in hexadecimal) |
\\ |
Back slash |
type
Constant |
Barcode type |
---|---|
BARCODE_UPC_A |
UPC-A |
BARCODE_UPC_E |
UPC-E |
BARCODE_EAN13 |
EAN13 |
BARCODE_JAN13 |
JAN13 |
BARCODE_EAN8 |
EAN8 |
BARCODE_JAN8 |
JAN8 |
BARCODE_CODE39 |
CODE39 |
BARCODE_ITF |
ITF |
BARCODE_CODABAR |
CODABAR |
BARCODE_CODE93 |
CODE93 |
BARCODE_CODE128 |
CODE128 |
BARCODE_CODE128_AUTO |
CODE128 auto |
BARCODE_GS1_128 |
GS1-128 |
BARCODE_GS1_DATABAR_OMNIDIRECTIONAL |
GS1 DataBar Omnidirectional |
BARCODE_GS1_DATABAR_TRUNCATED |
GS1 DataBar Truncated |
BARCODE_GS1_DATABAR_LIMITED |
GS1 DataBar Limited |
BARCODE_GS1_DATABAR_EXPANDED |
GS1 DataBar Expanded |
Barcode type |
Description |
---|---|
UPC-A |
If an 11-digit figure is specified, the check digit is automatically appended. If a 12-digit figure is specified, the 12th digit is used as the check digit but verification is not performed. |
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. |
JAN8 |
|
CODE39 |
If the first character is * , this character is processed as the start character. Otherwise, the start character is automatically added. |
ITF |
The start and stop codes are automatically added. Addition and verification of the check digit are not performed. |
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.
|
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. The parentheses are used as print
characters for HRI and not encoded as data.
|
hri
Constant |
Description |
---|---|
HRI_NONE (default) |
No printing. |
HRI_ABOVE |
Above the barcode |
HRI_BELOW |
Below the barcode |
HRI_BOTH |
Both above and below the barcode |
font
Constant |
Description |
---|---|
FONT_A (default) |
Font A |
FONT_B |
Font B |
FONT_C |
Font C |
FONT_D |
Font D |
FONT_E |
Font E |
width
Default: 3
Value |
Description |
---|---|
Integer from 2 to 6 |
Specifies the width of a single module in dots. |
height
Default: 162
Value |
Description |
---|---|
Integer from 1 to 255 |
Specifies the height of the barcode in dots. |
Return value
Return value |
Object type |
---|---|
Printer object |
Printer |
HybridPrinter2 object |
HybridPrinter2 |
Exception
Exception |
Object type |
---|---|
Parameter " ... " is invalid |
Error |
Supplementary explanation
- Specify the addBarcode method at the beginning of a line.
- In the page mode, this method is executed at the current position with the lower-left dot of the barcode (except for HRI) as the reference point.
- Specify a string in accordance with the type of the barcode specified in type. The barcode is not printed if the string specified in data does not match the barcode type specified in type.
- 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
- ePOSDevice object
- Common to device objects
- OtherPeripheral object
- Display object
- createWindow method
- destroyWindow method
- setCurrentWindow method
- clearWindow method
- addCreateScreen method
- addCreateScreenCustom method
- createTextArea method
- destroyTextArea method
- setCurrentTextArea method
- clearTextArea method
- setCursorPosition method
- moveCursorPosition method
- setCursorType method
- addText method
- addReverseText method
- addMarquee method
- setBlink method
- setBrightness method
- addBackgroundColor method
- addStartSlideShow method
- addStopSlideShow method
- addDownloadImage method
- addRegisterDownloadImage method
- addNVImage method
- addClearImage method
- addSymbol method
- addClearSymbol method
- showClock method
- addCommand method
- send method
- reset method
- onreceive event
- Keyboard object
- POSKeyboard object
- MSR object
- Printer object
- addTextAlign method
- addTextLineSpace method
- addTextRotate method
- addText method
- addTextLang method
- addTextFont method
- addTextSmooth method
- addTextDouble method
- addTextSize method
- addTextStyle method
- addTextPosition method
- addTextVPosition method
- addFeedUnit method
- addFeedLine method
- addFeedPosition method
- addFeed method
- addImage method
- addLogo method
- addBarcode method
- addSymbol method
- addHLine method
- addVLineBegin method
- addVLineEnd method
- addPageBegin method
- addPageEnd method
- addPageArea method
- addPageDirection method
- addPagePosition method
- addPageLine method
- addPageRectangle method
- addRotateBegin method
- addRotateEnd method
- addCut method
- addPulse method
- addSound method
- addLayout method
- recover method
- addRecovery method
- reset method
- addReset method
- addCommand method
- send method
- print method
- getPrintJobStatus method
- startMonitor method
- stopMonitor method
- halftone property
- brightness property
- force property
- timeout property
- interval property
- drawerOpenLevel property
- message property
- onreceive event
- onstatuschange event
- onbatterystatuschange event
- ononline event
- onoffline event
- onpoweroff event
- oncoverok event
- oncoveropen event
- onpaperok event
- onpapernearend event
- onpaperend event
- ondrawerclosed event
- ondraweropen event
- onbatteryok event
- onbatterylow event
- HybridPrinter2 object
- lock method
- unlock method
- selectPaperType method
- waitInsertion method
- cancelInsertion method
- ejectPaper method
- sendData method
- print method
- readMicrData method
- cleanMicrReader method
- recover method
- reset method
- startMonitor method
- stopMonitor method
- setMessage method
- getMessage method
- halftone property
- brightness property
- force property
- paperType property
- interval property
- waitTime property
- enable40cplMode property
- onreceive event
- Scanner object
- SimpleSerial object
- GermanyFiscalElement object
- DeviceHubTerminal object
- CommBoxManager object
- CommBox object
- ePosDeviceConfiguration object
- Appendix
- Error Code List
- Key code list
- List of Supported Objects
- 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-T20II
- TM-T20III
- TM-T82III
- TM-T88VI
- TM-T88VII
- TM-L100
- TM-T70
- TM-T70II
- TM-T88IV
- TM-T88V
- TM-U220
- TM-U220II
- TM-U330
- TM-P20
- TM-P20II
- 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-U220IIB-i
- TM-T70II-DT
- TM-T70II-DT2
- TM-T88V-DT
- TM-T88VI-DT2
- TM-H6000IV-DT
- TM-T20
- TM-T82II
- TM-T83II
- TM-T90
- TM-L90
- TM-H6000IV
- Usage restriction by firmware version