4.2. ICommandBuilder¶
Provides a function to generate printer control commands.
Constant
Name
Contents
Initialization constants
Font style constants
Code Page constants
International character constants
Logo size constants
Alignment position constants
Paper cut constants
Cash drawer channel constants
Sound/Buzzer channel constants
Barcode symbology constants
Barcode width constants
PDF417 ECC (security level) constants
QR code model constants
QR code mistake correction level constants
Bitmap rotation constants
Black mark constants
Label constants
Printable area constants
Constants of CJK Unified Ideograph font in UTF-8
Constants to specify the hold print control
Hold print status constants
Method
Name
Contents
Begin document command is generated and added to the command buffer.
End document command is generated and added to the command buffer.
Initialization command is generated and added to the command buffer.
Data (Text and Command) is added to the command buffer.
Raw data (Text and Command) is added to the command buffer.
Select command of the font style is generated and added to the command buffer.
Select command of the code page is generated and added to the command buffer.
Select command of the international character mode is generated and added to the command buffer.
Line feed command is generated and added to the command buffer.
Unit feed command is generated and added to the command buffer.
Set command of the character space is generated and added to the command buffer.
Set command of the line space is generated and added to the command buffer.
Set command of the top margin is generated and added to the command buffer.
Select command of the emphasis mode is generated and added to the command buffer.
Select command of the invert mode is generated and added to the command buffer.
Select command of the multiple mode is generated and added to the command buffer.
Select command of the underline mode is generated and added to the command buffer.
Print command of the logo is generated and added to the command buffer.
Absolute position command is generated and added to the command buffer.
Alignment command is generated and added to the command buffer.
Generates a clear command, and then adds it to the command buffer.
Paper cut command is generated and added to the command buffer.
Cash drawer command is generated and added to the command buffer.
Sound/Buzzer command is generated and added to the command buffer.
Print command of the barcode is generated and added to the command buffer.
Print command of the absolute position barcode is generated and added to the command buffer.
Print command of the alignment barcode is generated and added to the command buffer.
Print command of the PDF417 is generated and added to the command buffer.
Print command of the absolute position PDF417 is generated and added to the command buffer.
Print command of the alignment PDF417 is generated and added to the command buffer.
Print command of the QR code is generated and added to the command buffer.
Print command of the absolute position QR code is generated and added to the command buffer.
Print command of the alignment QR code is generated and added to the command buffer.
Print command of the bitmap is generated and added to the command buffer.
Print command of the absolute position bitmap is generated and added to the command buffer.
Print command of the alignment bitmap is generated and added to the command buffer.
Black mark command is generated and added to the command buffer.
Label command is generated and added to the command buffer.
Begin page mode command is generated and added to the command buffer.
End page mode command is generated and added to the command buffer.
Vertical absolute position in page mode command is generated and added to the command buffer.
Print direction in page mode command is generated and added to the command buffer.
Set command of the printable area is generated and added to the command buffer.
A command to set the UTF-8 CJK Unified Ideograph font is generated and added to the command buffer.
A command to specify the hold print control by the printer firmware is generated and added to the command buffer.
A command to specify hold print status is generated and added to the command buffer.
Gets the command buffer.
Supported method for each model.
Model/Emulation |
mC-Print2 | mC-Print3 | mPOP | FVP10 | TSP100IV | TSP100IIIW | TSP100IIIBI | TSP100IIIU | TSP100IIU+ | TSP100ECO | TSP100U | TSP100GT | TSP100LAN | TSP650II | TSP650IISK | TSP700II | TSP800II | TUP500 | SM-S210i | SM-S220i | SM-S230i | SM-T300i/T300 | SM-T400i | BSC10 | SM-L200 | SM-L300 | SP700 | SK1-211/221/V211 | SK1-211/221/V211 Presenter | SK1-311/321/V311 | SK1-311/V311 Presenter | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
StarPRNT | StarPRNT | StarPRNT | StarLine | StarPRNT | StarGraphic | StarGraphic | StarGraphic | StarGraphic | StarGraphic | StarGraphic | StarGraphic | StarGraphic | StarLine | StarLine | StarLine | StarLine | StarLine | StarPRNT | EscPosMobile | StarPRNT | EscPosMobile | StarPRNT | EscPosMobile | StarPRNT | EscPosMobile | StarPRNT | EscPosMobile | EscPos | StarPRNT | StarPRNT | StarDotImpact | StarPRNT | StarPRNT | StarPRNT | StarPRNT | |
beginDocument |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
endDocument |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendInitialization |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
append |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendRaw |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendFontStyle |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | - | ✔ | - | ✔ | - | ✔ | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendCodePage |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendInternational |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendLineFeed |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendUnitFeed |
✔ | ✔ | ✔ | ✔ | ✔ | ✔[1] | ✔[1] | ✔[1] | ✔[1] | ✔[1] | ✔[1] | ✔[1] | ✔[1] | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendCharacterSpace |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendLineSpace |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendTopMargin |
- | ✔[2][3] | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
appendEmphasis |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendInvert |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendMultiple |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendMultipleHeight |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendMultipleWidth |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendUnderLine |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendLogo |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔[4] | ✔ | ✔[4] | ✔ | ✔[4] | ✔ | ✔[4] | ✔ | ✔[4] | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendAbsolutePosition |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendAlignment |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendHorizontalTabPosition |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | - | ✔ | - | ✔ | - | ✔ | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendCutPaper |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔[5] | ✔[5] | ✔[5] | ✔[5] | ✔[5] | ✔[5] | ✔[5] | ✔[5] | ✔[5] | ✔[5] | ✔ | ✔[5] | ✔[5] | ✔ | ✔ | ✔ | ✔ | ✔ |
appendPeripheral |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | - | - | - | ✔ | - | - | ✔ | - | - | - | - |
appendSound |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | - | - | - | ✔ | - | - | ✔ | - | - | - | - |
appendBarcode [6] |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | ✔ | ✔ | ✔ |
appendBarcodeWithAbsolutePosition [6] |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | ✔ | ✔ | ✔ |
appendBarcodeWithAlignment [6] |
✔ | ✔ | ✔ | ✔ | ✔ | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔[7] | ✔ | ✔[7] | ✔ | ✔[7] | ✔ | ✔[7] | ✔ | ✔[7] | ✔ | ✔ | ✔ | - | ✔ | ✔ | ✔ | ✔ |
appendPdf417 |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | ✔ | ✔ | ✔ |
appendPdf417WithAbsolutePosition |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | ✔ | ✔ | ✔ |
appendPdf417WithAlignment |
✔ | ✔ | ✔ | ✔ | ✔ | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔[7] | ✔ | ✔[7] | ✔ | ✔[7] | ✔ | ✔[7] | ✔ | ✔[7] | ✔ | ✔ | ✔ | - | ✔ | ✔ | ✔ | ✔ |
appendQrCode |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | ✔ | ✔ | ✔ |
appendQrCodeWithAbsolutePosition |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | ✔ | ✔ | ✔ |
appendQrCodeWithAlignment |
✔ | ✔ | ✔ | ✔ | ✔ | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔[7] | ✔ | ✔[7] | ✔ | ✔[7] | ✔ | ✔[7] | ✔ | ✔[7] | ✔ | ✔ | ✔ | - | ✔ | ✔ | ✔ | ✔ |
appendBitmap |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔[8] | ✔ | ✔[8] | ✔ | ✔[8] | ✔ | ✔[8] | ✔ | ✔[8] | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendBitmapWithAbsolutePosition |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔[8] | ✔ | ✔[8] | ✔ | ✔[8] | ✔ | ✔[8] | ✔ | ✔[8] | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendBitmapWithAlignment |
✔ | ✔ | ✔ | ✔ | ✔ | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔[7] | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔[7][8] | ✔ | ✔[7][8] | ✔ | ✔[7][8] | ✔ | ✔[7][8] | ✔ | ✔[7][8] | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendBlackMark |
- | - | - | ✔ | - | - | - | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | - | - | - | - | - | - | ✔[9][10] | ✔[11] | ✔[9][10] | ✔[11] | ✔ | ✔[9][10] | ✔[10][11] | ✔ | ✔ | ✔ | ✔ | ✔ |
appendLabel |
- | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | ✔ | - | ✔ | - |
beginPageMode |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔[13] | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | ✔ | ✔ | ✔ |
endPageMode |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔[13] | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | ✔ | ✔ | ✔ |
appendPageModeVerticalAbsolutePosition |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔[13] | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | ✔ | ✔ | ✔ |
appendPageModeRotation |
✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔[13] | - | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | ✔ | ✔ | ✔ |
appendPrintableArea |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | - | - | - | - | - | - | - | - | - | - | ✔ | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
appendCjkUnifiedIdeographFont |
✔ | ✔ | - | - | ✔ | - | - | - | - | - | - | - | - | ✔[12] | ✔ | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
appendHoldPrint |
- | - | - | - | - | - | - | - | - | - | - | - | - | - | ✔ | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | ✔ | - | ✔ | - |
appendPaperPresentStatus |
- | - | - | - | - | - | - | - | - | - | - | - | - | - | ✔ | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | ✔ | - | ✔ | - |
[1] | Do not append data, append unit feed command only. |
[2] | When the top margin is set to 10 mm or less, the paper length (cut length) should not exceed 50mm. (If the cut paper remains at the paper-exit, a paper jam may occur. There is no limitation when the cut paper is removed.) |
[3] | MCP30 is not supported. |
[4] | Always print from normal size. |
[5] | Without paper cut. |
[6] | Confirm that the printed barcode can be read properly in real environment. |
[7] | Always print from left side. |
[8] | The maximum vertical direction printing area is 30cm (2400 dot). |
[9] | Only the front black mark can set enabled or disabled. Need to change printer setting to enable the back black mark (SM-T300i/T300 does not support the back black mark). Refer to hardware manual for how to change. |
[10] | Library version 1.13.0 or later is required |
[11] | Need to change printer setting to enable the black mark. Refer to hardware manual for how to change. |
[12] | JP2/TW model with Firmware version 4.0 or later is required. |
[13] | F/W Version 7.1 or later is required. |
4.2.1. InitializationType¶
Initialization constants
Declaration
enum InitializationType { Command }
Constants
Name Contents Command Command initialization
4.2.2. FontStyleType¶
Font style constants
Declaration
enum FontStyleType { A, B }
Constants
Name Contents A Font-A (12 x 24 dots) / Specify 7 x 9 font (half dots) B Font-B (9 x 24 dots) / Specify 5 x 9 font (2P-1)
4.2.3. CodePageType¶
Code Page constants
Declaration
enum CodePageType { CP437, CP737, CP772, CP774, CP851, CP852, CP855, CP857, CP858, CP860, CP861, CP862, CP863, CP864, CP865, CP866, CP869, CP874, CP928, CP932, CP998, CP999, CP1001, CP1250, CP1251, CP1252, CP2001, CP3001, CP3002, CP3011, CP3012, CP3021, CP3041, CP3840, CP3841, CP3843, CP3844, CP3845, CP3846, CP3847, CP3848, UTF8, Blank }
Constants
Name Contents CP437 CodePage 437 (USA, Std. Europe) CP737 Codepage 737 (Greek) CP772 Codepage 772 (Lithuanian) CP774 Codepage 774 (Lithuanian) CP851 Codepage 851 (Greek) CP852 Codepage 852 (Latin-2) CP855 Codepage 855 (Cyrillic Bulgarian) CP857 Codepage 857 (Turkey) CP858 Codepage 858 (Multilingual) CP860 Codepage 860 (Portuguese) CP861 Codepage 861 (Icelandic) CP862 Codepage 862 (Israel (Hebrew)) CP863 Codepage 863 (Canadian French) CP864 Codepage 864 (Arabic) CP865 Codepage 865 (Nordic) CP866 Codepage 866 (Cyrillic Russian) CP869 Codepage 869 (Greek) CP874 Codepage 874 (Thai) CP928 Codepage 928 (Greek) CP932 Katakana CP998 Normal CP999 Codepage 1252 (Windows Latin-1) CP1001 Codepage 1001 (Arabic) CP1250 Codepage 1250 (Windows Latin-2) CP1251 Codepage 1251 (Windows Cyrillic) CP1252 Codepage 1252 (Windows Latin-1) CP2001 Codepage 2001 (Lithuanian-KBL) CP3001 Codepage 3001 (Estonian-1) CP3002 Codepage 3002 (Estonian-2) CP3011 Codepage 3011 (Latvian-1) CP3012 Codepage 3012 (Latvian-2) CP3021 Codepage 3021 (Bulgarian) CP3041 Codepage 3041 (Maltese) CP3840 Codepage 3840 (IBM-Russian) CP3841 Codepage 3841 (Gost) CP3843 Codepage 3843 (Polish) CP3844 Codepage 3844 (CS2) CP3845 Codepage 3845 (Hungarian) CP3846 Codepage 3846 (Turkish) CP3847 Codepage 3847 (Brazil-ABNT) CP3848 Codepage 3848 (Brazil-ABICOMP) UTF8 UTF-8 Blank User Setting Blank Code Page
4.2.4. InternationalType¶
International character constants
Declaration
enum InternationalType { USA, France, Germany, UK, Denmark, Sweden, Italy, Spain, Japan, Norway, Denmark2, Spain2, LatinAmerica, Korea, Ireland, Legal }
Constants
Name Contents USA USA France France Germany Germany UK UK Denmark Denmark Sweden Sweden Italy Italy Spain Spain Japan Japan Norway Norway Denmark2 Denmark2 Spain2 Spain2 LatinAmerica Latin America Korea Korea Ireland Ireland Legal Legal
4.2.5. LogoSize¶
Logo size constants
Declaration
enum LogoSize { Normal, DoubleWidth, DoubleHeight, DoubleWidthDoubleHeight }
Constants
Name Contents Normal Normal DoubleWidth Double Width DoubleHeight Double Height DoubleWidthDoubleHeight Double Width / Height
4.2.6. AlignmentPosition¶
Alignment position constants
Declaration
enum AlignmentPosition { Left, Center, Right }
Constants
Name Contents Left Left alignment Center Center alignment Right Right alignment
4.2.7. CutPaperAction¶
Paper cut constants
Declaration
enum CutPaperAction { FullCut, PartialCut, FullCutWithFeed, PartialCutWithFeed }
Constants
Name Contents FullCut Full Cut PartialCut Partial Cut FullCutWithFeed Full Cut with Feed PartialCutWithFeed Partial Cut with Feed
4.2.8. PeripheralChannel¶
Cash drawer channel constants
Declaration
enum PeripheralChannel { No1, No2 };
Constants
Name Contents No1 Channel1 No2 Channel2
4.2.9. SoundChannel¶
Sound/Buzzer channel constants
Declaration
enum SoundChannel { No1, No2 }
Constants
Name Contents No1 Channel1 No2 Channel2
4.2.10. BarcodeSymbology¶
Barcode symbology constants
Declaration
enum BarcodeSymbology { UPCE, UPCA, JAN8, JAN13, Code39, ITF, Code128, Code93, NW7 }
Constants
Name Contents UPCE UPC-E UPCA UPC-A JAN8 JAN/EAN8 JAN13 JAN/EAN13 Code39 Code39 ITF ITF Code128 Code128 Code93 Code93 NW7 NW7
4.2.11. BarcodeWidth¶
Barcode width constants
By specifying ExtMode, the barcode mode conforming to each command specification is set.
Declaration
enum BarcodeWidth { Mode1, Mode2, Mode3, Mode4, Mode5, Mode6, Mode7, Mode8, Mode9, ExtMode1, ExtMode2, ExtMode3, ExtMode4, ExtMode5, ExtMode6, ExtMode7, ExtMode8, ExtMode9 }
Constants
Name
Contents
Library version
Mode1
Mode1
1.3.0+ Mode2
Mode2
1.3.0+ Mode3
Mode3
1.3.0+ Mode4
Mode4
1.3.0+ Mode5
Mode5
1.3.0+ Mode6
Mode6
1.3.0+ Mode7
Mode7
1.3.0+ Mode8
Mode8
1.3.0+ Mode9
Mode9
1.3.0+ ExtMode1
ExtMode1
1.11.0+ ExtMode2
ExtMode2
1.11.0+ ExtMode3
ExtMode3
1.11.0+ ExtMode4
ExtMode4
1.11.0+ ExtMode5
ExtMode5
1.11.0+ ExtMode6
ExtMode6
1.11.0+ ExtMode7
ExtMode7
1.11.0+ ExtMode8
ExtMode8
1.11.0+ ExtMode9
ExtMode9
1.11.0+
4.2.12. Pdf417Level¶
PDF417 ECC (security level) constants
Declaration
enum Pdf417Level { ECC0, ECC1, ECC2, ECC3, ECC4, ECC5, ECC6, ECC7, ECC8 };
Constants
Name Contents ECC0 Level0 ECC1 Level1 ECC2 Level2 ECC3 Level3 ECC4 Level4 ECC5 Level5 ECC6 Level6 ECC7 Level7 ECC8 Level8
4.2.13. QrCodeModel¶
QR code model constants
Declaration
enum QrCodeModel { No1, No2 };
Constants
Name Contents No1 Model1 No2 Model2
4.2.14. QrCodeLevel¶
QR code mistake correction level constants
Declaration
enum QrCodeLevel { L, M, Q, H }
Constants
Name Contents L Level L M Level M Q Level Q H Level H
4.2.15. BitmapConverterRotation¶
Bitmap rotation constants
Declaration
enum BitmapConverterRotation { Normal, Right90, Left90, Rotate180 }
Constants
Name Contents Normal Rotated 0 Right90 Rotated 90 Left90 Rotated 270 Rotate180 Rotated 180
4.2.16. BlackMarkType¶
added in version 1.5.0
Black mark constants
Declaration
enum BlackMarkType { Invalid, Valid, ValidWithDetection }
Constants
Name Contents Invalid Black mark invalid Valid Black mark valid ValidWithDetection Black mark valid with detection
4.2.17. LabelType¶
added in version 1.14.0
Label constants
Declaration
enum LabelType { Invalid, Valid, ValidWithDetection }
Constants
Name Contents Invalid Label invalid Valid Label invalid ValidWithDetection Label valid with detection
4.2.18. PrintableAreaType¶
added in version 1.8.0
Printable area constants
Declaration
enum PrintableAreaType { Standard, Type1, Type2, Type3, Type4 }
Constants
Name Contents Standard Standard type Type1 Type1 Type2 Type2 Type3 Type3 Type4 Type4
4.2.19. CjkUnifiedIdeographFont¶
added in version 1.11.0
Constants of CJK Unified Ideograph font in UTF-8
Declaration
enum CjkUnifiedIdeographFont { Japanese, SimplifiedChinese, TraditionalChinese, Hangul }
Constants
Name Contents Japanese Japanese font SimplifiedChinese Simplified Chinese font TraditionalChinese Traditional Chinese font Hangul Hangul font
4.2.20. HoldPrintType¶
added in version 1.14.0
Constants to specify the hold print control
Declaration
enum HoldPrintType { Invalid, Valid, Default }
Constants
Name Contents Invalid Invalid Valid Valid Default Follow the memory switch setting
4.2.21. PaperPresentStatusType¶
added in version 1.14.0
Hold print status constants
Declaration
enum PaperPresentStatusType { Invalid, Valid, Default }
Constants
Name Contents Invalid Invalid Valid Valid Default Follow the memory switch setting
4.2.22. beginDocument¶
Begin document command is generated and added to the command buffer.
Declaration
void beginDocument();
Parameter
None
Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.23. endDocument¶
End document command is generated and added to the command buffer.
Declaration
void endDocument();
Parameter
None
Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.24. appendInitialization¶
Initialization command is generated and added to the command buffer.
Declaration
void appendInitialization(InitializationType type);
Parameter
Name Contents Type type Initialization type InitializationType Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendUnderLine(true); builder.appendMultiple(2, 2); builder.append(data); builder.appendInitialization(InitializationType.Command); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFragment.java.
4.2.25. append¶
Data (Text and Command) is added to the command buffer.
Declaration
void append(byte data); void append(byte[] data);
Parameter
Name Contents Type data Data (Text and Command) bytebyte[]Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.".getBytes(); byte[] data = new byte[] {0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e}; ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append(data); builder.append((byte) 0x0a); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.26. appendRaw¶
Raw data (Text and Command) is added to the command buffer.
Declaration
void appendRaw(byte data); void appendRaw(byte[] data);
Parameter
Name Contents Type data Raw data (Text and Command) bytebyte[]Return value
None
Examples
public static byte[] createData(Context context, Emulation emulation, Bitmap bitmap, RequestCallback callback) { ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendBitmap(bitmap, false); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
4.2.27. appendFontStyle¶
Select command of the font style is generated and added to the command buffer.
Declaration
void appendFontStyle(FontStyleType type);
Parameter
Name Contents Type type Font style FontStyleType Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendFontStyle(FontStyleType.A); builder.append(data); builder.appendFontStyle(FontStyleType.B); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.28. appendCodePage¶
Select command of the code page is generated and added to the command buffer.
Declaration
void appendCodePage(CodePageType type);
Parameter
Name Contents Type type Code Page CodePageType Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data8 = new byte[] {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x0a}; byte[] data9 = new byte[] {0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0x0a}; byte[] dataA = new byte[] {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0x0a}; byte[] dataB = new byte[] {0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0x0a}; byte[] dataC = new byte[] {0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0x0a}; byte[] dataD = new byte[] {0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0x0a}; byte[] dataE = new byte[] {0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0x0a}; byte[] dataF = new byte[] {0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0x0a}; ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendCodePage(CodePageType.CP932); builder.append(data8); builder.append(data9); builder.append(dataA); builder.append(dataB); builder.append(dataC); builder.append(dataD); builder.append(dataE); builder.append(dataF); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.29. appendInternational¶
Select command of the international character mode is generated and added to the command buffer.
Declaration
void appendInternational(InternationalType type);
Parameter
Name Contents Type type International character InternationalType Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = new byte[] {0x23, 0x24, 0x40, 0x58, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x60, 0x7b, 0x7c, 0x7d, 0x7e, 0x0a}; ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendInternational(InternationalType.USA); builder.append(data); builder.appendInternational(InternationalType.Japan); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.30. appendLineFeed¶
Line feed command is generated and added to the command buffer.
Declaration
void appendLineFeed(); void appendLineFeed(byte[] data); void appendLineFeed(int line); void appendLineFeed(byte[] data, int line);
Parameter
Name Contents Type line Paper feed units. (Units : Lines) int data Data (Text and Command) byte[] Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append(data); builder.appendLineFeed); builder.appendLineFeed(data); builder.append(data); builder.appendLineFeed(2); builder.appendLineFeed(data, 2); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.31. appendUnitFeed¶
Unit feed command is generated and added to the command buffer.
Declaration
void appendUnitFeed(int unit); void appendUnitFeed(byte[] data, int unit);
Parameter
Name Contents Type unit Paper feed units. (Units : Dots) int data Data (Text and Command) byte[] Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append(data); builder.appendUnitFeed(64); builder.appendUnitFeed(data, 64); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.32. appendCharacterSpace¶
Set command of the character space is generated and added to the command buffer.
Declaration
void appendCharacterSpace(int space);
Parameter
Name Contents Type space Character spaces. (Units : Dots) int Return value
None
Important
In Japanese, Simplified Chinese, Traditional Chinese, and Korean (DBCS), the character space is to be twice.
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendCharacterSpace(0); builder.append(data); builder.appendCharacterSpace(4); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.33. appendLineSpace¶
Set command of the line space is generated and added to the command buffer.
Declaration
void appendLineSpace(int lineSpace);
Parameter
Name Contents Type lineSpace Line spaces. (Units : Dots) int Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendLineSpace(32); builder.append(data); builder.append(data); builder.append(data); builder.appendLineSpace(24); builder.append(data); builder.append(data); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.34. appendTopMargin¶
added in version 1.8.0
Set command of the top margin is generated and added to the command buffer.
Declaration
void appendTopMargin(int margin);
Parameter
Name Contents Type margin Top margin. (Units : Millimeter) int Return value
None
Examples
public static byte[] createTopMarginData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendTopMargin(2); builder.append("*Top margin:2mm*\n".getBytes()); builder.append(data); builder.append(data); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.appendTopMargin(6); builder.append("*Top margin:6mm*\n".getBytes()); builder.append(data); builder.append(data); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.appendTopMargin(11); // Default builder.append("*Top margin:11mm*\n".getBytes()); builder.append(data); builder.append(data); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.35. appendEmphasis¶
Select command of the emphasis mode is generated and added to the command buffer.
Declaration
void appendEmphasis(boolean emphasis); void appendEmphasis(byte[] data);
Parameter
Name Contents Type emphasis Emphasistrue … Validfalse … Invalidboolean data Data (Text and Command) byte[] Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); byte[] dataHalf0 = "Hello ".getBytes(); byte[] dataHalf1 = "World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append(data); builder.appendEmphasis(true); builder.append(data); builder.append(data); builder.appendEmphasis(false); builder.append(data); builder.appendEmphasis(data); builder.append(data); builder.appendEmphasis(dataHalf0); builder.append(dataHalf1); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.36. appendInvert¶
Select command of the invert mode is generated and added to the command buffer.
Declaration
void appendInvert(boolean invert); void appendInvert(byte[] data);
Parameter
Name Contents Type invert Inverttrue … Validfalse … Invalidboolean data Data (Text and Command) byte[] Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); byte[] dataHalf0 = "Hello ".getBytes(); byte[] dataHalf1 = "World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append(data); builder.appendInvert(true); builder.append(data); builder.append(data); builder.appendInvert(false); builder.append(data); builder.appendInvert(data); builder.append(data); builder.appendInvert(dataHalf0); builder.append(dataHalf1); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.37. appendMultiple¶
Select command of the multiple mode is generated and added to the command buffer.
Declaration
void appendMultiple(int width, int height); void appendMultiple(byte[] data, int width, int height); void appendMultipleHeight(int height); void appendMultipleHeight(byte[] data, int height); void appendMultipleWidth(int width); void appendMultipleWidth(byte[] data, int width);
Parameter
Name Contents Type width Expanded width int height Expanded height int data Data (Text and Command) byte[] Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); byte[] dataHalf0 = "Hello ".getBytes(); byte[] dataHalf1 = "World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append(data); builder.appendMultiple(2, 2); builder.append(data); builder.append(data); builder.appendMultiple(1, 1); builder.append(data); builder.appendMultiple(data, 2, 2); builder.append(data); builder.appendMultiple(dataHalf0, 2, 2); builder.append(dataHalf1); builder.append(dataHalf0); builder.appendMultiple(dataHalf1 2, 2); builder.appendMultipleHeight(2); builder.append(data); builder.append(data); builder.appendMultipleHeight(1); builder.append(data); builder.appendMultipleHeight(dataHalf0, 2); builder.append(dataHalf1); builder.append(dataHalf0); builder.appendMultipleHeight(dataHalf1, 2); builder.appendMultipleWidth(2); builder.append(data); builder.append(data); builder.appendMultipleWidth(1); builder.append(data); builder.appendMultipleWidth(dataHalf0, 2); builder.append(dataHalf1); builder.append(dataHalf0); builder.appendMultipleWidth(dataHalf1, 2); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.38. appendUnderLine¶
Select command of the underline mode is generated and added to the command buffer.
Declaration
void appendUnderLine(boolean underLine); void appendUnderLine(byte[] data);
Parameter
Name Contents Type underLine Under linetrue … Validfalse … Invalidboolean data Data (Text and Command) byte[] Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); byte[] dataHalf0 = "Hello ".getBytes(); byte[] dataHalf1 = "World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append(data); builder.appendUnderLine(true); builder.append(data); builder.append(data); builder.appendUnderLine(false); builder.append(data); builder.appendUnderLine(data); builder.append(data); builder.appendUnderLine(dataHalf0); builder.append(dataHalf1); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.39. appendLogo¶
Print command of the logo is generated and added to the command buffer.
Declaration
void appendLogo(LogoSize size, int number);
Parameter
Name Contents Type size Logo size LogoSize number Logo number int Return value
None
Examples
public static byte[] createData(Emulation emulation) { ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendLogo(LogoSize.Normal, 1); builder.appendLogo(LogoSize.DoubleWidth, 1); builder.appendLogo(LogoSize.DoubleHeight, 1); builder.appendLogo(LogoSize.DoubleWidthDoubleHeight, 1); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.40. appendAbsolutePosition¶
Absolute position command is generated and added to the command buffer.
Declaration
void appendAbsolutePosition(int position); void appendAbsolutePosition(byte[] data, int position);
Parameter
Name Contents Type position Absolute position. (Units : Dots) int data Data (Text and Command) byte[] Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append(data); builder.appendAbsolutePosition(40); builder.append(data); builder.append(data); builder.appendAbsolutePosition(data, 40); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.41. appendAlignment¶
Alignment command is generated and added to the command buffer.
Declaration
void appendAlignment(AlignmentPosition position); void appendAlignment(byte[] data, AlignmentPosition position);
Parameter
Name Contents Type position Alignment position AlignmentPosition data Data (Text and Command) byte[] Return value
None
Important
This method cannot be used with appendBitmap, appendBarcode, appendQrCode and appendPdf417 for alignment. Instead, please use appendBitmapWithAlignment, appendBarcodeWithAlignment, appendQrCodeWithAlignment and appendPdf417WithAlignment respectively.
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append(data); builder.appendAlignment(AlignmentPosition.Right); builder.append(data); builder.append(data); builder.appendAlignment(AlignmentPosition.Left); builder.append(data); builder.append(data); builder.appendAlignment(data, AlignmentPosition.Right); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.42. appendHorizontalTabPosition¶
added in version 1.7.0
Horizontal tab set/clear command is generated and added to the command buffer.
Declaration
void appendHorizontalTabPosition(int[] positions);
Parameter
Name Contents Type positions Array of horizontal tab positions (Units: ANK character pitch)Specifying null or empty array deletes all currently set horizontal tab positions.int[] Return value
None
Examples
public static byte[] createHorizontalTabData(Emulation emulation) { byte[] data1 = "QTY\tITEM\tTOTAL\n".getBytes(); byte[] data2 = "1\tApple\t1.50\n".getBytes(); byte[] data3 = "2\tOrange\t2.00\n".getBytes(); byte[] data4 = "5\tBanana\t3.00\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendHorizontalTabPosition(new int[] {5, 27}); builder.append("*Tab Position:5, 27*\n".getBytes()); builder.append(data1); builder.append(data2); builder.append(data3); builder.append(data4); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.43. appendCutPaper¶
Paper cut command is generated and added to the command buffer.
Declaration
void appendCutPaper(CutPaperAction action);
Parameter
Name Contents Type action Paper cut CutPaperAction Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append(data); builder.append(data); builder.append(data); builder.append(data); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.44. appendPeripheral¶
Cash drawer command is generated and added to the command buffer.
Declaration
void appendPeripheral(PeripheralChannel channel); void appendPeripheral(PeripheralChannel channel, int time);
Parameter
Name Contents Type channel Cash drawer channel PeripheralChannel time Drive time. (Units : mSec)* Peripheral channel1 only.int Return value
None
Examples
public static byte[] createData(Emulation emulation) { ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendPeripheral(PeripheralChannel.No1); builder.appendPeripheral(PeripheralChannel.No2); builder.appendPeripheral(PeripheralChannel.No1, 2000); builder.appendPeripheral(PeripheralChannel.No2, 2000); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.45. appendSound¶
Sound/Buzzer command is generated and added to the command buffer.
Declaration
void appendSound(SoundChannel channel); void appendSound(SoundChannel channel, int repeat); void appendSound(SoundChannel channel, int repeat, int driveTime, int delayTime);
Parameter
Name
Contents
Type
Library version
channel Sound/Buzzer channel
1.3.0+ repeat Repeat count
int
1.3.0+ driveTime Drive time. (Units : mSec)
int
1.8.0+ delayTime Delay time. (Units : mSec)
int
1.8.0+ Return value
None
Warning
Do not use this method with anything other than the buzzer connected. It may not work properly, and the printer or the peripheral unit in use may cause damage.
Examples
public static byte[] createData(Emulation emulation) { ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendSound(SoundChannel.No1); builder.appendSound(SoundChannel.No2); builder.appendSound(SoundChannel.No1, 3); builder.appendSound(SoundChannel.No2, 3); builder.appendSound(SoundChannel.No1, 1, 1000, 1000); builder.appendSound(SoundChannel.No2, 1, 1000, 1000); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.46. appendBarcode¶
Print command of the barcode is generated and added to the command buffer.
Declaration
void appendBarcode(byte[] data, BarcodeSymbology symbology, BarcodeWidth width, int height, boolean hri);
Parameter
Name Contents Type data Barcode data byte[] symbology Barcode symbology BarcodeSymbology width Barcode width BarcodeWidth height Barcode height. (Units : Dots) int hri Under-bar characterstrue … Validfalse … Invalidboolean Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] dataCode128 = "{B0123456789".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendBarcode(dataCode128, BarcodeSymbology.Code128, BarcodeWidth.Mode1, 40, true); builder.appendUnitFeed(32); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.47. appendBarcodeWithAbsolutePosition¶
Print command of the absolute position barcode is generated and added to the command buffer.
Declaration
void appendBarcodeWithAbsolutePosition(byte[] data, BarcodeSymbology symbology, BarcodeWidth width, int height, boolean hri, int position);
Parameter
Name Contents Type position Absolute position. (Units : Dots) int data Barcode data byte[] symbology Barcode symbology BarcodeSymbology width Barcode width BarcodeWidth height Barcode height. (Units : Dots) int hri Under-bar characterstrue … Validfalse … Invalidboolean Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] dataCode128 = "{B0123456789".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendBarcodeWithAbsolutePosition(dataCode128, BarcodeSymbology.Code128, BarcodeWidth.Mode1, 40, true, 40); builder.appendUnitFeed(32); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.48. appendBarcodeWithAlignment¶
Print command of the alignment barcode is generated and added to the command buffer.
Declaration
void appendBarcodeWithAlignment(byte[] data, BarcodeSymbology symbology, BarcodeWidth width, int height, boolean hri, AlignmentPosition position);
Parameter
Name Contents Type position Alignment position AlignmentPosition data Barcode data byte[] symbology Barcode symbology BarcodeSymbology width Barcode width BarcodeWidth height Barcode height. (Units : Dots) int hri Under-bar characterstrue … Validfalse … Invalidboolean Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] dataCode128 = "{B0123456789".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendBarcodeWithAlignment(dataCode128, BarcodeSymbology.Code128, BarcodeWidth.Mode1, 40, true, AlignmentPosition.Center); builder.appendUnitFeed(32); builder.appendBarcodeWithAlignment(dataCode128, BarcodeSymbology.Code128, BarcodeWidth.Mode1, 40, true, AlignmentPosition.Right); builder.appendUnitFeed(32); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.49. appendPdf417¶
Print command of the PDF417 is generated and added to the command buffer.
Declaration
void appendPdf417(byte[] data, int line, int column, Pdf417Level level, int module, int aspect);
Parameter
Name Contents Type data PDF417 data byte[] line Number of lines int column Number of columns int level PDF417 ECC (security level) Pdf417Level module Module X direction size int aspect Module aspect ratio int Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendPdf417(data, 0, 1, Pdf417Level.ECC0, 2, 2); builder.appendUnitFeed(32); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.50. appendPdf417WithAbsolutePosition¶
Print command of the absolute position PDF417 is generated and added to the command buffer.
Declaration
void appendPdf417WithAbsolutePosition(byte[] data, int line, int column, Pdf417Level level, int module, int aspect, int position);
Parameter
Name Contents Type position Absolute position. (Units : Dots) int data PDF417 data byte[] line Number of lines int column Number of columns int level PDF417 ECC (security level) Pdf417Level module Module X direction size int aspect Module aspect ratio int Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendPdf417WithAbsolutePosition(data, 0, 1, Pdf417Level.ECC0, 2, 2, 40); builder.appendUnitFeed(32); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.51. appendPdf417WithAlignment¶
Print command of the alignment PDF417 is generated and added to the command buffer.
Declaration
void appendPdf417WithAlignment(byte[] data, int line, int column, Pdf417Level level, int module, int aspect, AlignmentPosition position);
Parameter
Name Contents Type position Alignment position AlignmentPosition data PDF417 data byte[] line Number of lines int column Number of columns int level PDF417 ECC (security level) Pdf417Level module Module X direction size int aspect Module aspect ratio int Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendPdf417WithAlignment(data, 0, 1, Pdf417Level.ECC0, 2, 2, AlignmentPosition.Center); builder.appendUnitFeed(32); builder.appendPdf417WithAlignment(data, 0, 1, Pdf417Level.ECC0, 2, 2, AlignmentPosition.Right); builder.appendUnitFeed(32); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.52. appendQrCode¶
Print command of the QR code is generated and added to the command buffer.
Declaration
void appendQrCode(byte[] data, QrCodeModel model, QrCodeLevel level, int cell);
Parameter
Name Contents Type data QR code data byte[] model QR code model QrCodeModel level QR code mistake correction level QrCodeLevel cell QR code cell size int Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendQrCode(data, QrCodeModel.No2, QrCodeLevel.L, 4); builder.appendUnitFeed(32); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.53. appendQrCodeWithAbsolutePosition¶
Print command of the absolute position QR code is generated and added to the command buffer.
Declaration
void appendQrCodeWithAbsolutePosition(byte[] data, QrCodeModel model, QrCodeLevel level, int cell, int position);
Parameter
Name Contents Type position Absolute position. (Units : Dots) int data QR code data byte[] model QR code model QrCodeModel level QR code mistake correction level QrCodeLevel cell QR code cell size int Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendQrCodeWithAbsolutePosition(data, QrCodeModel.No2, QrCodeLevel.L, 4, 40); builder.appendUnitFeed(32); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.54. appendQrCodeWithAlignment¶
Print command of the alignment QR code is generated and added to the command buffer.
Declaration
void appendQrCodeWithAlignment(byte[] data, QrCodeModel model, QrCodeLevel level, int cell, AlignmentPosition position);
Parameter
Name Contents Type position Alignment position AlignmentPosition data QR code data byte[] model QR code model QrCodeModel level QR code mistake correction level QrCodeLevel cell QR code cell size int Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendQrCodeWithAlignment(data, QrCodeModel.No2, QrCodeLevel.L, 4, AlignmentPosition.Center); builder.appendUnitFeed(32); builder.appendQrCodeWithAlignment(data, QrCodeModel.No2, QrCodeLevel.L, 4, AlignmentPosition.Right); builder.appendUnitFeed(32); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java and each Command Specifications.
4.2.55. appendBitmap¶
Print command of the bitmap is generated and added to the command buffer.
Declaration
void appendBitmap(Bitmap bitmap, boolean diffusion, int width, boolean bothScale, BitmapConverterRotation rotation); void appendBitmap(Bitmap bitmap, boolean diffusion, BitmapConverterRotation rotation); void appendBitmap(Bitmap bitmap, boolean diffusion, int width, boolean bothScale); void appendBitmap(Bitmap bitmap, boolean diffusion);
Parameter
Name Contents Type bitmap Source bitmap object android.graphics.Bitmap diffusion Random dithertrue … Validfalse … Invalidboolean width Bitmap width after conversion. (Units : Dots) int bothScale Height is changed according to the conversion rate of the width property.true … Validfalse … Invalidboolean rotation Rotation. BitmapConverterRotation Return value
None
Examples
public static byte[] createData(Emulation emulation, int width, Context context) { Bitmap starLogoBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.star_logo_image); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append("\n*Normal*\n".getBytes()); builder.appendBitmap(starLogoBitmap, true); builder.append("\n*width:Full, bothScale:true*\n".getBytes()); builder.appendBitmap(starLogoBitmap, true, width, true); builder.append("\n*width:Full, bothScale:false*\n".getBytes()); builder.appendBitmap(starLogoBitmap, true, width, false); builder.append("\n*Rotate180*\n".getBytes()); builder.appendBitmap(starLogoBitmap, true, BitmapConverterRotation.Rotate180); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.56. appendBitmapWithAbsolutePosition¶
Print command of the absolute position bitmap is generated and added to the command buffer.
Declaration
void appendBitmapWithAbsolutePosition(Bitmap bitmap, boolean diffusion, int width, boolean bothScale, BitmapConverterRotation rotation, int position); void appendBitmapWithAbsolutePosition(Bitmap bitmap, boolean diffusion, BitmapConverterRotation rotation, int position); void appendBitmapWithAbsolutePosition(Bitmap bitmap, boolean diffusion, int width, boolean bothScale, int position); void appendBitmapWithAbsolutePosition(Bitmap bitmap, boolean diffusion, int position);
Parameter
Name Contents Type position Absolute position. (Units : Dots) int bitmap Source bitmap object android.graphics.Bitmap diffusion Random dithertrue … Validfalse … Invalidboolean width Bitmap width after conversion. (Units : Dots) int bothScale Height is changed according to the conversion rate of the width property.true … Validfalse … Invalidboolean rotation Rotation. BitmapConverterRotation Return value
None
Examples
public static byte[] createData(Emulation emulation, int width, Context context) { Bitmap starLogoBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.star_logo_image); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append("\n*Normal, AbsolutePosition:40*\n".getBytes()); builder.appendBitmapWithAbsolutePosition(starLogoBitmap, true, 40); builder.append("\n*width:Full, bothScale:true, AbsolutePosition:40*\n".getBytes()); builder.appendBitmap(starLogoBitmap, true, width, true, 40); builder.append("\n*width:Full, bothScale:false, AbsolutePosition:40*\n".getBytes()); builder.appendBitmap(starLogoBitmap, true, width, false, 40); builder.append("\n*Rotate180, AbsolutePosition:40*\n".getBytes()); builder.appendBitmapWithAbsolutePosition(starLogoBitmap, true, BitmapConverterRotation.Rotate180, 40); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.57. appendBitmapWithAlignment¶
Print command of the alignment bitmap is generated and added to the command buffer.
Declaration
void appendBitmapWithAlignment(Bitmap bitmap, boolean diffusion, int width, boolean bothScale, BitmapConverterRotation rotation, AlignmentPosition position); void appendBitmapWithAlignment(Bitmap bitmap, boolean diffusion, BitmapConverterRotation rotation, AlignmentPosition position); void appendBitmapWithAlignment(Bitmap bitmap, boolean diffusion, int width, boolean bothScale, AlignmentPosition position); void appendBitmapWithAlignment(Bitmap bitmap, boolean diffusion, AlignmentPosition position);
Parameter
Name Contents Type position Alignment position AlignmentPosition bitmap Source bitmap object android.graphics.Bitmap diffusion Random dithertrue … Validfalse … Invalidboolean width Bitmap width after conversion. (Units : Dots) int bothScale Height is changed according to the conversion rate of the width property.true … Validfalse … Invalidboolean rotation Rotation. BitmapConverterRotation Return value
None
Examples
public static byte[] createData(Emulation emulation, int width, Context context) { Bitmap starLogoBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.star_logo_image); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append("\n*Normal, Alignment:Center*\n".getBytes()); builder.appendBitmapWithAlignment(starLogoBitmap, true, AlignmentPosition.Center); builder.append("\n*width:Full, bothScale:true, Alignment:Center*\n".getBytes()); builder.appendBitmapWithAlignment(starLogoBitmap, true, width, true, AlignmentPosition.Center); builder.append("\n*width:Full, bothScale:false, Alignment:Center*\n".getBytes()); builder.appendBitmapWithAlignment(starLogoBitmap, true, width, false, AlignmentPosition.Center); builder.append("\n*Rotate180, Alignment:Center*\n".getBytes()); builder.appendBitmapWithAlignment(starLogoBitmap, true, BitmapConverterRotation.Rotate180, AlignmentPosition.Center); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.58. appendBlackMark¶
added in version 1.5.0
Black mark command is generated and added to the command buffer.
Declaration
void appendBlackMark(BlackMarkType type);
Parameter
Name Contents Type type Black mark BlackMarkType Return value
None
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendBlackMark(BlackMarkType.Valid); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); // builder.appendBlackMark(BlackMarkType.Invalid); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.59. appendLabel¶
added in version 1.14.0
Label command is generated and added to the command buffer.
Declaration
void appendLabel(LabelType type);
Parameter
Name Contents Type type Label LabelType Return value
None
Examples
public static byte[] createLabelData(Emulation emulation, LabelType type) { byte[] data = "Hello World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.appendLabel(type); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); // builder.appendLabel(LabelType.Invalid); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFragment.java.
4.2.60. beginPageMode¶
added in version 1.5.0
Begin page mode command is generated and added to the command buffer.
Declaration
void beginPageMode(Rect rect, BitmapConverterRotation rotation);
Parameter
Name Contents Type rect Location and size. (Units : Dots) android.graphics.Rect rotation Print direction BitmapConverterRotation Return value
None
Examples
public static byte[] createData(Emulation emulation, int width) { byte[] data = "Hello World.\n".getBytes(); int left = 0; int top = 0; int height = 30 * 8; // 30mm!!! ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append("\n*Rotate180 Text*\n".getBytes()); Rect rect = new Rect(left, top, left + width, top + height); builder.beginPageMode(rect, BitmapConverterRotation.Rotate180); builder.appendPageModeVerticalAbsolutePosition(height / 2); builder.appendAbsolutePosition(data, width / 2); builder.endPageMode(); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.61. endPageMode¶
added in version 1.5.0
End page mode command is generated and added to the command buffer.
Declaration
void endPageMode();
Parameter
None
Return value
None
Examples
public static byte[] createData(Emulation emulation, int width) { byte[] data = "Hello World.\n".getBytes(); int left = 0; int top = 0; int height = 30 * 8; // 30mm!!! ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append("\n*Rotate180 Text*\n".getBytes()); Rect rect = new Rect(left, top, left + width, top + height); builder.beginPageMode(rect, BitmapConverterRotation.Rotate180); builder.appendPageModeVerticalAbsolutePosition(height / 2); builder.appendAbsolutePosition(data, width / 2); builder.endPageMode(); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.62. appendPageModeVerticalAbsolutePosition¶
added in version 1.5.0
Vertical absolute position in page mode command is generated and added to the command buffer.
Declaration
void appendPageModeVerticalAbsolutePosition(int position);
Parameter
Name Contents Type position Vertical absolute position in page mode. (Units : Dots) int Return value
None
Examples
public static byte[] createData(Emulation emulation, int width) { byte[] data = "Hello World.\n".getBytes(); int left = 0; int top = 0; int height = 30 * 8; // 30mm!!! ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append("\n*Rotate180 Text*\n".getBytes()); Rect rect = new Rect(left, top, left + width, top + height); builder.beginPageMode(rect, BitmapConverterRotation.Rotate180); builder.appendPageModeVerticalAbsolutePosition(height / 2); builder.appendAbsolutePosition(data, width / 2); builder.endPageMode(); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.63. appendPageModeRotation¶
added in version 1.5.0
Print direction in page mode command is generated and added to the command buffer.
Declaration
void appendPageModeRotation(BitmapConverterRotation rotation);
Parameter
Name Contents Type rotation Print direction BitmapConverterRotation Return value
None
Examples
public static byte[] createData(Emulation emulation, int width) { byte[] data = "Hello World.\n".getBytes(); int left = 0; int top = 0; int height = 30 * 8; // 30mm!!! ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append("\n*Mixed Text*\n".getBytes()); Rect rect = new Rect(left, top, left + width, top + height); builder.beginPageMode(rect, BitmapConverterRotation.Normal); builder.appendPageModeVerticalAbsolutePosition(height / 2); builder.appendAbsolutePosition(data, width / 2); builder.appendPageModeRotation(BitmapConverterRotation.Rotate180); builder.appendPageModeVerticalAbsolutePosition(height / 2); builder.appendAbsolutePosition(data, width / 2); builder.endPageMode(); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.64. appendPrintableArea¶
added in version 1.8.0
Set command of the printable area is generated and added to the command buffer.
Declaration
void appendPrintableArea(PrintableAreaType type);
Parameter
Name Contents Type type Printable area PrintableAreaType Return value
None
Unit:mm
The relationship between the specified PrintableAreaType and the print area to be set is the following.
Model/Emulation |
mC-Print2 | mC-Print3 | mPOP | FVP10 | TSP100IV | TSP100IIIW | TSP100IIIBI | TSP100IIIU | TSP100ECO | TSP100U | TSP100GT | TSP100LAN | TSP650II | TSP650IISK | TSP700II | TSP800II | TUP500 | SM-S210i | SM-S220i | SM-S230i | SM-T300i/T300 | SM-T400i | BSC10 | SM-L200 | SM-L300 | SP700 | SK1-211/221/V211 | SK1-211/221/V211 Presenter | SK1-311/321/V311 | SK1-311/V311 Presenter | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
StarPRNT | StarPRNT | StarPRNT | StarLine | StarPRNT | StarGraphic | StarGraphic | StarGraphic | StarGraphic | StarGraphic | StarGraphic | StarGraphic | StarLine | StarLine | StarLine | StarLine | StarLine | StarPRNT | EscPosMobile | StarPRNT | EscPosMobile | StarPRNT | EscPosMobile | StarPRNT | EscPosMobile | StarPRNT | EscPosMobile | EscPos | StarPRNT | StarPRNT | StarDotImpact | StarPRNT | StarPRNT | StarPRNT | StarPRNT | |
Standard |
48 | 72[1] | 48 | 72[1] | 72[1] | 72[1] | 72[1] | 72[1] | 72[1] | 72[1] | 72[1] | 72[1] | 72[1] | 72[1] | 72[1] | 104[2] | - | - | - | - | - | - | - | - | - | - | - | 64[1][3] | - | 72[1] | 63 | 54 | 54 | 72[1] | 72[1] |
Type1 |
54 | - | 54 | 52.5 | 51 | 51 | 51 | 51 | 51 | 51 | 51 | 51 | - | 34.5 | 52.5 | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | 48 | - | - | 54 | 54 |
Type2 |
- | 48 | - | - | 48 | - | - | - | - | - | - | - | - | 32 | 80[1] | 72 | - | - | - | - | - | - | - | - | - | - | - | - | - | - | 60 | 56 | 56 | 56 | 56 |
Type3 |
50.8 | 50.8 | 50.8 | 50.8 | 50.8 | - | - | - | - | - | - | - | 50.8 | 50.8 | 50.8 | - | - | - | - | - | - | - | - | - | - | - | - | 45[3] | - | 50.8 | 45 | - | - | 68[1] | 68[1] |
Type4 |
- | - | - | 52 | - | - | - | - | - | - | - | - | - | - | 52 | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | 57 | - | - | 80[1] | 80[1] |
[1] | When 2-inch paper is used, do not set a print area with width 3 inches. |
[2] | When 3-inch paper is used, do not set a print area with width 4 inches. |
[3] | When “Maximum number of lines” is set for the number of memory switch print lines, 72 mm is set for Standard and 50.8 mm is set for Type 3. (Bit 4 of memory switch 4 is set to 1.) |
Examples
public static byte[] createPrintableAreaData(Emulation emulation, PrintableAreaType type, Context context) { ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); Bitmap printableAreaImage = BitmapFactory.decodeResource(context.getResources(), R.drawable.printable_area_image); byte[] data1 = "123456789".getBytes(); byte[] data2 = "0".getBytes(); builder.beginDocument(); builder.appendPrintableArea(type); switch (type) { //case Standard: default: builder.append("*Standard*\n".getBytes()); break; case Type1: builder.append("*Type1*\n".getBytes()); break; case Type2: builder.append("*Type2*\n".getBytes()); break; case Type3: builder.append("*Type3*\n".getBytes()); break; case Type4: builder.append("*Type4*\n".getBytes()); break; } builder.appendBitmap(printableAreaImage, true); builder.append(data1); builder.appendInvert(data2); builder.append(data1); builder.appendInvert(data2); builder.append(data1); builder.appendInvert(data2); builder.append(data1); builder.appendInvert(data2); builder.append(data1); builder.appendInvert(data2); builder.append(data1); builder.appendInvert(data2); builder.append(data1); builder.appendInvert(data2); builder.append(data1); builder.appendInvert(data2); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.
4.2.65. appendCjkUnifiedIdeographFont¶
added in version 1.11.0
A command to set the UTF-8 CJK Unified Ideograph font is generated and added to the command buffer.
Declaration
void appendCjkUnifiedIdeographFont(CjkUnifiedIdeographFont ... font);
Parameter
Name Contents Type font CJK Unified Ideograph font in UTF-8When two or more fonts are specified, the font specified earlier is printed first.If nothing is specified for the argument, the font setting of the CJK Unified Ideograph is returned to the memory switch setting.CjkUnifiedIdeographFont Return value
None
Examples
public void append3inchTextReceiptData(ICommandBuilder builder, boolean utf8) { Charset encoding; encoding = Charset.forName("UTF-8"); builder.appendCodePage(CodePageType.UTF8); builder.appendCharacterSpace(0); builder.appendAlignment(AlignmentPosition.Center); builder.append("2017 / 5 / 15 AM 10:00\n".getBytes(encoding)); builder.appendMultiple(2, 2); // This function is supported by TSP650II(JP2/TW models only) with F/W version 4.0 or later and mC-Print2/3. // Switch Kanji/Hangul font by specifying the font for Unicode CJK Unified Ideographs before each word. builder.appendCjkUnifiedIdeographFont(CjkUnifiedIdeographFont.Japanese); builder.append("受付票 ".getBytes(encoding)); builder.appendCjkUnifiedIdeographFont(CjkUnifiedIdeographFont.TraditionalChinese); builder.append("排號單\n".getBytes(encoding)); builder.appendCjkUnifiedIdeographFont(CjkUnifiedIdeographFont.SimplifiedChinese); builder.append("排号单 ".getBytes(encoding)); builder.appendCjkUnifiedIdeographFont(CjkUnifiedIdeographFont.Hangul); builder.append("접수표\n\n".getBytes(encoding)); builder.appendMultiple(1, 1); builder.appendCjkUnifiedIdeographFont(); builder.appendMultiple("1\n".getBytes(encoding), 6, 6); builder.append("------------------------------------------\n".getBytes(encoding)); builder.appendCjkUnifiedIdeographFont(CjkUnifiedIdeographFont.Japanese); builder.append("ご本人がお持ちください。\n".getBytes(encoding)); builder.append("※紛失しないようにご注意ください。\n".getBytes(encoding)); }
Refer to Utf8MultiLanguageReceiptsImpl.java.
4.2.66. appendHoldPrint¶
added in version 1.14.0
A command to specify the hold print control by the printer firmware is generated and added to the command buffer.
Declaration
void appendHoldPrint(HoldPrintType type);
Parameter
Name Contents Type type Hold print control HoldPrintType Return value
None
Note
To enable the hold print control
The following settings enable the control of awaiting paper removal ( beginCheckedBlock method is blocked until paper is removed). See also the Example on next page.
- Disable the hold print control by the printer firmware using the command generated by this method.
- Enable hold print status using the command generated by the appendPaperPresentStatus method.
Examples
public static List<byte[]> createHoldPrintData(Emulation emulation, boolean[] isHoldArray) { List<byte[]> commandList = new ArrayList<>(); for (int i = 0; i < isHoldArray.length; i++) { ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); IBezelCommandBuilder bezelBuilder = StarIoExt.createBezelCommandBuilder(emulation); // Enable bezel. bezelBuilder.appendBezelMode(Mode.Valid); builder.append(bezelBuilder.getCommands()); // Disable hold print controlled by printer firmware. builder.appendHoldPrint(HoldPrintType.Invalid); if (isHoldArray[i]) { // Enable paper present status if wait paper removal before next printing. builder.appendPaperPresentStatus(PaperPresentStatusType.Valid); } else { // Disable paper present status if do not wait paper removal before next printing. builder.appendPaperPresentStatus(PaperPresentStatusType.Invalid); } // Create commands for printing. ... commandList.add(builder.getCommands()); } return commandList; }
Refer to PrinterFunctions.java.
4.2.67. appendPaperPresentStatus¶
added in version 1.14.0
A command to specify hold print status is generated and added to the command buffer.
Declaration
void appendPaperPresentStatus(PaperPresentStatusType type);
Parameter
Name Contents Type type Hold print status PaperPresentStatusType Return value
None
Examples
Refer to the example of the appendHoldPrint method.
4.2.68. getCommands¶
Gets the command buffer.
Declaration
byte[] getCommands();
Parameter
None
Return value
Contents Type Command buffer byte[]
Examples
public static byte[] createData(Emulation emulation) { byte[] data = "Hello World.\n".getBytes(); ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); builder.beginDocument(); builder.append(data); builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); builder.endDocument(); return builder.getCommands(); }
Refer to ApiFunctions.java.