4.2. ICommandBuilder

Provides a function to generate printer control commands.

  • Method

    Name

    Contents

    BeginDocument

    Begin document command is generated and added to the command buffer.

    EndDocument

    End document command is generated and added to the command buffer.

    AppendInitialization

    Initialization command is generated and added to the command buffer.

    AppendData

    Data (Text and Command) is added to the command buffer.

    AppendRawData

    Raw data (Text and Command) is added to the command buffer.

    AppendFontStyle

    Select command of the font style is generated and added to the command buffer.

    AppendCodePage

    Select command of the code page is generated and added to the command buffer.

    AppendInternational

    Select command of the international character mode is generated and added to the command buffer.

    AppendLineFeed

    Line feed command is generated and added to the command buffer.

    AppendUnitFeed

    Unit feed command is generated and added to the command buffer.

    AppendCharacterSpace

    Set command of the character space is generated and added to the command buffer.

    AppendLineSpace

    Set command of the line space is generated and added to the command buffer.

    AppendTopMargin

    Set command of the top margin is generated and added to the command buffer.

    AppendEmphasis

    Select command of the emphasis mode is generated and added to the command buffer.

    AppendInvert

    Select command of the invert mode is generated and added to the command buffer.

    AppendMultiple

    Select command of the multiple mode is generated and added to the command buffer.

    AppendUnderLine

    Select command of the underline mode is generated and added to the command buffer.

    AppendLogo

    Print command of the logo is generated and added to the command buffer.

    AppendAbsolutePosition

    Absolute position command is generated and added to the command buffer.

    AppendAlignment

    Alignment command is generated and added to the command buffer.

    AppendHorizontalTabPosition

    Generates a clear command, and then adds it to the command buffer.

    AppendCutPaper

    Paper cut command is generated and added to the command buffer.

    AppendPeripheral

    Cash drawer command is generated and added to the command buffer.

    AppendSound

    Sound/Buzzer command is generated and added to the command buffer.

    AppendBarcodeData

    Print command of the barcode is generated and added to the command buffer.

    AppendBarcodeDataWithAbsolutePosition

    Print command of the absolute position barcode is generated and added to the command buffer.

    AppendBarcodeDataWithAlignment

    Print command of the alignment barcode is generated and added to the command buffer.

    AppendPdf417Data

    Print command of the PDF417 is generated and added to the command buffer.

    AppendPdf417DataWithAbsolutePosition

    Print command of the absolute position PDF417 is generated and added to the command buffer.

    AppendPdf417DataWithAlignment

    Print command of the alignment PDF417 is generated and added to the command buffer.

    AppendQrCodeData

    Print command of the QR code is generated and added to the command buffer.

    AppendQrCodeDataWithAbsolutePosition

    Print command of the absolute position QR code is generated and added to the command buffer.

    AppendQrCodeDataWithAlignment

    Print command of the alignment QR code is generated and added to the command buffer.

    AppendBitmapAsync

    Print command of the bitmap is generated and added to the command buffer.

    AppendBitmapWithAbsolutePositionAsync

    Print command of the absolute position bitmap is generated and added to the command buffer.

    AppendBitmapWithAlignmentAsync

    Print command of the alignment bitmap is generated and added to the command buffer.

    AppendBlackMark

    Black mark detection command is generated and added to the command buffer.

    AppendLabel

    Gap detection command for die-cut label paper, etc is generated and added to the command buffer.

    BeginPageMode

    Begin page mode command is generated and added to the command buffer.

    EndPageMode

    End page mode command is generated and added to the command buffer.

    AppendPageModeVerticalAbsolutePosition

    Vertical absolute position in page mode command is generated and added to the command buffer.

    AppendPageModeRotation

    Print direction in page mode command is generated and added to the command buffer.

    AppendPrintableArea

    Set command of the printable area is generated and added to the command buffer.

    AppendCjkUnifiedIdeographFont

    A command to set the UTF-8 CJK Unified Ideograph font is generated and added to the command buffer.

    AppendHoldPrint

    A command to specify the hold print control by the printer firmware is generated and added to the command buffer.

    AppendPaperPresentStatus

    A command to specify hold print status is generated and added to the command buffer.

    GetCommands

    Gets the command buffer.

Supported method for each model.

Model/Emulation

mC-Print2 mC-Print3 mC-Label3 mPOP FVP10 TSP100IV TSP100IV SK TSP100IIIW TSP100IIIBITSP100LAN TSP650II TSP650IISK TSP700II TSP800IISM-S210i SM-S220i SM-S230i SM-T300i/T300 SM-T400i BSC10II BSC10 SM-L200 SM-L300 SP700
StarPRNT StarPRNT StarPRNT StarPRNT StarLine StarPRNT StarPRNT StarGraphic StarGraphic StarGraphic StarLine StarLine StarLine StarLine StarPRNT EscPosMobile StarPRNT EscPosMobile StarPRNT EscPosMobile StarPRNT EscPosMobile StarPRNT EscPosMobile StarPRNT EscPos StarPRNT StarPRNT StarDotImpact

BeginDocument

EndDocument

AppendInitialization

- - -

AppendData

- - -

AppendRawData

AppendFontStyle

- - - - - - - -

AppendCodePage

- - -

AppendInternational

- - -

AppendLineFeed

- - -

AppendUnitFeed

[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

- - - - - - - - - - - -

AppendBarcodeData

[6]
-

AppendBarcodeDataWithAbsolutePosition

[6]
-

AppendBarcodeDataWithAlignment

[6]
[7] [7] [7] [7] [7] [7] [7] [7] -

AppendPdf417Data

-

AppendPdf417DataWithAbsolutePosition

-

AppendPdf417DataWithAlignment

[7] [7] [7] [7] [7] [7] [7] [7] -

AppendQrCodeData

-

AppendQrCodeDataWithAbsolutePosition

-

AppendQrCodeDataWithAlignment

[7] [7] [7] [7] [7] [7] [7] [7] -

AppendBitmapAsync

[8] [8] [8] [8] [8]

AppendBitmapWithAbsolutePositionAsync

[8] [8] [8] [8] [8]

AppendBitmapWithAlignmentAsync

[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.

[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.9.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

    public enum InitializationType {
        Command
    }
    
  • Constants

    Name

    Contents

    Command

    Command initialization

4.2.2. FontStyleType

Font style constants

  • Declaration

    public 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

    public 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

    public enum InternationalType {
        USA,
        France,
        Germany,
        UK,
        Denmark,
        Sweden,
        Italy,
        Spain,
        Japan,
        Norway,
        Denmark2,
        Spain2,
        LatinAmerica,
        Korea,
        Ireland,
        India,
        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

    India

    India [1]

    Legal

    Legal

    [1] Only BSC10II is supported.

4.2.5. LogoSize

Logo size constants

  • Declaration

    public 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

    public 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

    public enum CutPaperAction {
        FullCut,
        PartialCut,
        FullCutWithFeed,
        PartialCutWithFeed,
        TearOff
    }
    
  • Constants

    Name

    Contents

    FullCut

    Full Cut

    PartialCut

    Partial Cut

    FullCutWithFeed

    Full Cut with Feed

    PartialCutWithFeed

    Partial Cut with Feed

    TearOff

    Only Feed (No Cut)

4.2.8. PeripheralChannel

Cash drawer channel constants

  • Declaration

    public enum PeripheralChannel {
        No1,
        No2
    }
    
  • Constants

    Name

    Contents

    No1

    Channel1

    No2

    Channel2

4.2.9. SoundChannel

Sound/Buzzer channel constants

  • Declaration

    public enum SoundChannel {
        No1,
        No2
    }
    
  • Constants

    Name

    Contents

    No1

    Channel1

    No2

    Channel2

4.2.10. BarcodeSymbology

Barcode symbology constants

  • Declaration

    public 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

    public 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.1.0+

    Mode2

    Mode2

    1.1.0+

    Mode3

    Mode3

    1.1.0+

    Mode4

    Mode4

    1.1.0+

    Mode5

    Mode5

    1.1.0+

    Mode6

    Mode6

    1.1.0+

    Mode7

    Mode7

    1.1.0+

    Mode8

    Mode8

    1.1.0+

    Mode9

    Mode9

    1.1.0+

    ExtMode1

    ExtMode1

    1.8.0+

    ExtMode2

    ExtMode2

    1.8.0+

    ExtMode3

    ExtMode3

    1.8.0+

    ExtMode4

    ExtMode4

    1.8.0+

    ExtMode5

    ExtMode5

    1.8.0+

    ExtMode6

    ExtMode6

    1.8.0+

    ExtMode7

    ExtMode7

    1.8.0+

    ExtMode8

    ExtMode8

    1.8.0+

    ExtMode9

    ExtMode9

    1.8.0+

4.2.12. Pdf417Level

PDF417 ECC (security level) constants

  • Declaration

    public 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

    public enum QrCodeModel {
        No1,
        No2
    }
    
  • Constants

    Name

    Contents

    No1

    Model1

    No2

    Model2

4.2.14. QrCodeLevel

QR code mistake correction level constants

  • Declaration

    public 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

    public 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.2.0

Black mark detection constants

  • Declaration

    public enum BlackMarkType {
        Invalid,
        Valid,
        ValidWithDetection
    }
    
  • Constants

    Name

    Contents

    Invalid

    Black mark detection invalid

    Valid

    Black mark detection valid

    ValidWithDetection

    Black mark detection valid with detect at power on

4.2.17. LabelType

added in version 1.11.0

Gap detection constants for die-cut label paper, etc

  • Declaration

    public enum LabelType {
        Invalid,
        Valid,
        ValidWithDetection
    }
    
    • Constants

      Name

      Contents

      Invalid

      Gap detection invalid

      Valid

      Gap detection valid

      ValidWithDetection

      Gap detection valid with detect at power on

4.2.18. PrintableAreaType

added in version 1.4.0

Printable area constants

  • Declaration

    public 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.8.0

Constants of CJK Unified Ideograph font in UTF-8

  • Declaration

    public 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.10.0

Constants to specify the hold print control

  • Declaration

    public 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.10.0

Hold print status constants

  • Declaration

    public 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 IBuffer CreateData(Emulation emulation)
    {
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.").AsBuffer();
    
        builder.BeginDocument();
    
        builder.AppendData(otherData);
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

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 IBuffer CreateData(Emulation emulation)
    {
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.").AsBuffer();
    
        builder.BeginDocument();
    
        builder.AppendData(otherData);
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

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 IBuffer CreateData(Emulation emulation)
    {
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        builder.BeginDocument();
    
        builder.AppendData(otherData);
    
        builder.AppendMultiple(2, 2);
        builder.AppendData(otherData);
    
        builder.AppendInitialization(InitializationType.Command);
        builder.AppendData(otherData);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.25. AppendData

Data (Text and Command) is added to the command buffer.

  • Declaration

    void AppendData(IBuffer otherData)
    void AppendByte(byte data)
    void AppendBytes(byte[] bytes, int length)
    
  • Parameter

    Name

    Contents

    Type

    otherData
    data
    bytes
    length

    Data (Text and Command)

    IBuffer
    byte
    byte[]
    int
  • Return value

    None

  • Examples

    public static IBuffer CreateGenericData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.").AsBuffer();
        byte[] bytes = { 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e };
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(otherData);
        builder.AppendByte(0x0a);
        builder.AppendBytes(bytes, bytes.Length);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs and each Command Specifications.

4.2.26. AppendRawData

Raw data (Text and Command) is added to the command buffer.

  • Declaration

    void AppendRawData(IBuffer otherData)
    void AppendRawByte(byte data)
    void AppendRawBytes(byte[] bytes, int length)
    
  • Parameter

    Name

    Contents

    Type

    otherData
    data
    bytes
    length

    Raw data (Text and Command)

    IBuffer
    byte
    byte[]
    int
  • Return value

    None

  • Examples

    public static IBuffer CreateGenericData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.").AsBuffer();
        byte[] bytes = { 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e };
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendRawData(otherData);
        builder.AppendRawByte(0x0a);
        builder.AppendRawBytes(bytes, bytes.Length);
    
        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 IBuffer CreateFontStyleData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendFontStyle(FontStyleType.A);
        builder.AppendData(otherData);
    
        builder.AppendFontStyle(FontStyleType.B);
        builder.AppendData(otherData);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs 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 IBuffer CreateCodePageData(Emulation emulation)
    {
        byte[] bytes2 = new byte[] { 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x0a };
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendCodePage(CodePageType.CP998);
    
        builder.AppendBytes(bytes2, bytes2.Length); builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs 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 IBuffer CreateInternationalData(Emulation emulation)
    {
        byte[] bytes = { 0x23, 0x24, 0x40, 0x58, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x60, 0x7b, 0x7c, 0x7d, 0x7e, 0x0a };
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendInternational(InternationalType.USA);
    
        builder.AppendBytes(bytes, bytes.Length);
    
        builder.AppendInternational(InternationalType.Japan);
    
        builder.AppendBytes(bytes, bytes.Length);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs and each Command Specifications.

4.2.30. AppendLineFeed

Line feed command is generated and added to the command buffer.

  • Declaration

    void AppendLineFeed()
    void AppendDataWithLineFeed(IBuffer otherData)
    void AppendBytesWithLineFeed(byte[] bytes, int length)
    void AppendLineFeed(int line)
    void AppendDataWithLineFeed(IBuffer otherData, int line)
    void AppendBytesWithLineFeed(byte[] bytes, int length, int line)
    
  • Parameter

    Name

    Contents

    Type

    line

    Paper feed units. (Units : Lines)

    int

    otherData
    bytes
    length

    Data (Text and Command)

    IBuffer
    byte[]
    int
  • Return value

    None

  • Examples

    public static IBuffer CreateFeedData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(otherData);
    
        builder.AppendLineFeed();
    
        builder.AppendDataWithLineFeed(otherData)
    
        builder.AppendData(otherData);
    
        builder.AppendLineFeed(2);
    
        builder.AppendDataWithLineFeed(otherData, 2);
    
        builder.AppendCutPaper(CutPaperAction.FullCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.31. AppendUnitFeed

Unit feed command is generated and added to the command buffer.

  • Declaration

    void AppendUnitFeed(int unit)
    void AppendDataWithUnitFeed(IBuffer otherData, int unit)
    void AppendBytesWithUnitFeed(byte[] bytes, int length, int unit)
    
  • Parameter

    Name

    Contents

    Type

    unit

    Paper feed units. (Units : Dots)

    int

    otherData
    bytes
    length

    Data (Text and Command)

    IBuffer
    byte[]
    int
  • Return value

    None

  • Examples

    public static IBuffer CreateFeedData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(otherData);
        builder.AppendUnitFeed(64);
    
        builder.AppendDataWithUnitFeed(otherData, 64);
    
        builder.AppendCutPaper(CutPaperAction.FullCutWithFeed);
        builder.EndDocument();
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

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 IBuffer CreateCharacterSpaceData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendCharacterSpace(0);
        builder.AppendDataWithLineFeed(otherData);
        builder.AppendCharacterSpace(4);
        builder.AppendDataWithLineFeed(otherData);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
        builder.EndDocument();
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

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 IBuffer CreateLineSpaceData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
        builder.BeginDocument();
    
        builder.AppendLineSpace(32);
        builder.AppendDataWithLineFeed(otherData);
        builder.AppendDataWithLineFeed(otherData);
        builder.AppendDataWithLineFeed(otherData);
        builder.AppendLineSpace(24);
        builder.AppendDataWithLineFeed(otherData);
        builder.AppendDataWithLineFeed(otherData);
        builder.AppendDataWithLineFeed(otherData);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
        builder.EndDocument();
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs and each Command Specifications.

4.2.34. AppendTopMargin

added in version 1.4.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 IBuffer CreateTopMarginData(Emulation emulation)
    {
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.").AsBuffer();
    
        builder.BeginDocument();
    
        builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("*Top margin:2mm*\n").AsBuffer());
        builder.AppendTopMargin(2);
        builder.AppendDataWithLineFeed(otherData);
        builder.AppendDataWithLineFeed(otherData);
        builder.AppendDataWithLineFeed(otherData);
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("*Top margin:6mm*\n").AsBuffer());
        builder.AppendTopMargin(6);
        builder.AppendDataWithLineFeed(otherData);
        builder.AppendDataWithLineFeed(otherData);
        builder.AppendDataWithLineFeed(otherData);
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("*Top margin:11mm*\n").AsBuffer());
        builder.AppendTopMargin(11);
        builder.AppendDataWithLineFeed(otherData);
        builder.AppendDataWithLineFeed(otherData);
        builder.AppendDataWithLineFeed(otherData);
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs 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(bool emphasis)
    void AppendDataWithEmphasis(IBuffer otherData)
    void AppendBytesWithEmphasis(byte[] bytes, int length)
    
  • Parameter

    Name

    Contents

    Type

    emphasis

    Emphasis
    true … Valid
    false … Invalid

    bool

    otherData
    bytes
    length

    Data (Text and Command)

    IBuffer
    byte[]
    int
  • Return value

    None

  • Examples

    public static IBuffer CreateEmphasisData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
        IBuffer otherDataHalf0 = System.Text.Encoding.UTF8.GetBytes("Hello " ).AsBuffer();
        IBuffer otherDataHalf1 = System.Text.Encoding.UTF8.GetBytes( "World.\n").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(otherData);
        builder.AppendEmphasis(true);
        builder.AppendData(otherData);
        builder.AppendData(otherData);
        builder.AppendEmphasis(false);
        builder.AppendData(otherData);
    
        builder.AppendDataWithEmphasis(otherData);
        builder.AppendData(otherData);
    
        builder.appendEmphasis(dataHalf0);
        builder.AppendData(otherDataHalf1);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.36. AppendInvert

Select command of the invert mode is generated and added to the command buffer.

  • Declaration

    void AppendInvert(bool invert)
    void AppendDataWithInvert(IBuffer otherData)
    void AppendBytesWithInvert(byte[] bytes, int length)
    
  • Parameter

    Name

    Contents

    Type

    invert

    Invert
    true … Valid
    false … Invalid

    bool

    otherData
    bytes
    length

    Data (Text and Command)

    IBuffer
    byte[]
    int
  • Return value

    None

  • Examples

    public static IBuffer CreateInvertData (Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
        IBuffer otherDataHalf0 = System.Text.Encoding.UTF8.GetBytes("Hello " ).AsBuffer();
        IBuffer otherDataHalf1 = System.Text.Encoding.UTF8.GetBytes( "World.\n").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(otherData);
        builder.AppendInvert(true);
        builder.AppendData(otherData);
        builder.AppendData(otherData);
        builder.AppendInvert(false);
        builder.AppendData(otherData);
    
        builder.AppendDataWithInvert(otherData);
        builder.AppendData(otherData);
    
        builder.AppendDataWithInvert(otherDataHalf0);
        builder.AppendData(otherDataHalf1);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

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 AppendDataWithMultiple(IBuffer otherData, int width, int height)
    void AppendBytesWithMultiple(byte[] bytes, int length, int width, int height)
    void AppendMultipleHeight(int height)
    void AppendDataWithMultipleHeight(IBuffer otherData, int height)
    void AppendBytesWithMultipleHeight(byte[] bytes, int length, int height)
    void AppendMultipleWidth(int width)
    void AppendDataWithMultipleWidth(IBuffer otherData, int width)
    void AppendBytesWithMultipleWidth(byte[] bytes, int length, int width)
    
  • Parameter

    Name

    Contents

    Type

    width

    Expanded width

    int

    height

    Expanded height

    int

    otherData
    bytes
    length

    Data (Text and Command)

    IBuffer
    byte[]
    int
  • Return value

    None

  • Examples

    public static IBuffer CreateInvertData (Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
        IBuffer otherDataHalf0 = System.Text.Encoding.UTF8.GetBytes("Hello " ).AsBuffer();
        IBuffer otherDataHalf1 = System.Text.Encoding.UTF8.GetBytes( "World.\n").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendMultiple(2, 2);
        builder.AppendData(otherData);
        builder.AppendMultiple(1, 1);
        builder.AppendData(otherData);
    
        builder.AppendDataWithMultiple(otherData, 2, 2);
        builder.AppendData(otherData);
    
        builder.AppendDataWithMultiple(otherDataHalf0, 2, 2);
        builder.AppendData(otherDataHalf1);
    
        builder.AppendMultipleHeight(2);
        builder.AppendData(otherData);
        builder.AppendMultipleHeight(1);
        builder.AppendData(otherData);
    
        builder.AppendDataWithMultipleHeight(otherDataHalf0, 2);
        builder.AppendData(otherDataHalf1);
    
        builder.AppendMultipleWidth(2);
        builder.AppendData(otherData);
        builder.AppendMultipleWidth(1);
        builder.AppendData(otherData);
    
        builder.AppendDataWithMultipleWidth(otherDataHalf0, 2);
        builder.AppendData(otherDataHalf1);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs 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(bool underLine)
    void AppendDataWithUnderLine(IBuffer otherData)
    void AppendBytesWithUnderLine(byte[] bytes, int length)
    
  • Parameter

    Name

    Contents

    Type

    underLine

    Under line
    true … Valid
    false … Invalid

    bool

    otherData
    bytes
    length

    Data (Text and Command)

    IBuffer
    byte[]
    int
  • Return value

    None

  • Examples

    public static IBuffer CreateUnderLineData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
        IBuffer otherDataHalf0 = System.Text.Encoding.UTF8.GetBytes("Hello").AsBuffer();
        IBuffer otherDataHalf1 = System.Text.Encoding.UTF8.GetBytes( "World.\n").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(otherData);
    
        builder.AppendUnderLine(true);
        builder.AppendData(otherData);
        builder.AppendUnderLine(false);
        builder.AppendData(otherData);
    
        builder.AppendDataWithUnderLine(otherData);
        builder.AppendData(otherData);
    
        builder.AppendDataWithUnderLine(otherDataHalf0);
        builder.AppendData(otherDataHalf1);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.40. AppendAbsolutePosition

Absolute position command is generated and added to the command buffer.

  • Declaration

    void AppendAbsolutePosition(int position)
    void AppendDataWithAbsolutePosition(IBuffer otherData, int position)
    void AppendBytesWithAbsolutePosition(byte[] bytes, int length, int position)
    
  • Parameter

    Name

    Contents

    Type

    position

    Absolute position. (Units : Dots)

    int

    otherData
    bytes
    length

    Data (Text and Command)

    IBuffer
    byte[]
    int
  • Return value

    None

  • Examples

    public static IBuffer CreateAbsolutePositionData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(otherData);
    
        builder.AppendAbsolutePosition(40);
        builder.AppendData(otherData);
        builder.AppendData(otherData);
    
        builder.AppendDataWithAbsolutePosition(otherData, 40);
        builder.AppendData(otherData);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.41. AppendAlignment

Alignment command is generated and added to the command buffer.

  • Declaration

    void AppendAlignment(AlignmentPosition position)
    void AppendDataWithAlignment(IBuffer otherData, AlignmentPosition position)
    void AppendBytesWithAlignment(byte[] bytes, int length, AlignmentPosition position)
    
  • Parameter

    Name

    Contents

    Type

    position

    Alignment position

    AlignmentPosition

    otherData
    bytes
    length

    Data (Text and Command)

    IBuffer
    byte[]
    int
  • Return value

    None

  • Examples

    public static IBuffer CreateAlignmentData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(otherData);
    
        builder.AppendAlignment(AlignmentPosition.Right);
        builder.AppendData(otherData);
        builder.AppendData(otherData);
    
        builder.AppendAlignment(AlignmentPosition.Left);
        builder.AppendData(otherData);
        builder.AppendData(otherData);
    
        builder.AppendDataWithAlignment(otherData, AlignmentPosition.Right);
    
        builder.AppendData(otherData);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs and each Command Specifications.

4.2.42. AppendHorizontalTabPosition

added in version 1.4.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 IBuffer CreateHorizontalTabData(Emulation emulation)
    {
        byte[] data1 = System.Text.Encoding.UTF8.GetBytes("QTY\tITEM\tTOTAL\n");
        byte[] data2 = System.Text.Encoding.UTF8.GetBytes("1\tApple\t1.50\n");
        byte[] data3 = System.Text.Encoding.UTF8.GetBytes("2\tOrange\t2.00\n");
        byte[] data4 = System.Text.Encoding.UTF8.GetBytes("3\tBanana\t3.00\n");
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendHorizontalTabPosition(new int[] {5,27});
    
        builder.AppendData(Encoding.UTF8.GetBytes("*Tab Position:5,27*\n").AsBuffer());
    
        builder.AppendBytes(data1, data1.Length);
        builder.AppendBytes(data2, data2.Length);
        builder.AppendBytes(data3, data3.Length);
        builder.AppendBytes(data4, data4.Length);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.43. AppendCutPaper

Line feed and Paper cut commands are generated and added to the command buffer.

  • Declaration

    void AppendCutPaper(CutPaperAction action);
    
  • Parameter

    Name

    Contents

    Type

    action

    Paper cut

    CutPaperAction

  • Return value

    None

Note

Depending on the print data, line feeds may be performed before paper cut regardless of the value of the action argument.
If you want to perform paper cut without line feed, use AppendRawData and send a cutter controls command to the printer.
For details on the cutter control commands, please refer to the each Command Specifications.
(e.g., For StarPRNT or StarLine emulation, the cutter control command for a partial cut is 0x1b, 0x64, 0x03, and for a full cut is 0x1b, 0x64, 0x02.)
  • Examples

    public static IBuffer CreateCutPaperData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(otherData);
        builder.AppendData(otherData);
        builder.AppendData(otherData);
        builder.AppendData(otherData);
        builder.AppendData(otherData);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

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 IBuffer CreatePeripheralData(Emulation emulation)
    {
        ICommandBuilder builder = StarIO_Extension.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.cs 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

    SoundChannel

    1.1.0+
    repeat

    Repeat count

    int

    1.1.0+
    driveTime

    Drive time. (Units : mSec)

    int

    1.4.0+
    delayTime

    Delay time. (Units : mSec)

    int

    1.4.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 IBuffer CreateSoundData(Emulation emulation)
    {
        ICommandBuilder builder = StarIO_Extension.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.cs and each Command Specifications.

4.2.46. AppendBarcodeData

Print command of the barcode is generated and added to the command buffer.

  • Declaration

    void AppendBarcodeData(IBuffer otherData, BarcodeSymbology symbology, BarcodeWidth width, int height, bool hri)
    void AppendBarcodeBytes(byte[] bytes, int length, BarcodeSymbology symbology, BarcodeWidth width, int height, bool hri)
    
  • Parameter

    Name

    Contents

    Type

    otherData
    bytes
    length

    Barcode data

    IBuffer
    byte[]
    int

    symbology

    Barcode symbology

    BarcodeSymbology

    width

    Barcode width

    BarcodeWidth

    height

    Barcode height. (Units : Dots)

    int

    hri

    Under-bar characters
    true … Valid
    false … Invalid

    bool

  • Return value

    None

  • Examples

    public static IBuffer CreateBarcodeData(Emulation emulation)
    {
        IBuffer otherDataCode128 = System.Text.Encoding.UTF8.GetBytes("{B0123456789").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendBarcodeData(otherDataCode128, BarcodeSymbology.Code128, BarcodeWidth.Mode1, 40, true);
    
        builder.AppendUnitFeed(32);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs and each Command Specifications.

4.2.47. AppendBarcodeDataWithAbsolutePosition

Print command of the absolute position barcode is generated and added to the command buffer.

  • Declaration

    void AppendBarcodeDataWithAbsolutePosition(IBuffer otherData, BarcodeSymbology symbology, BarcodeWidth width, int height, bool hri, int position)
    void AppendBarcodeBytesWithAbsolutePosition(byte[] bytes, int length, BarcodeSymbology symbology, BarcodeWidth width, int height, bool hri, int position)
    
  • Parameter

    Name

    Contents

    Type

    position

    Absolute position. (Units : Dots)

    int

    otherData
    bytes
    length

    Barcode data

    IBuffer
    byte[]
    int

    symbology

    Barcode symbology

    BarcodeSymbology

    width

    Barcode width

    BarcodeWidth

    height

    Barcode height. (Units : Dots)

    int

    hri

    Under-bar characters
    true … Valid
    false … Invalid

    bool

  • Return value

    None

  • Examples

    public static IBuffer CreateBarcodeData(Emulation emulation)
    {
        IBuffer otherDataCode128 = System.Text.Encoding.UTF8.GetBytes("{B0123456789").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendBarcodeDataWithAbsolutePosition(otherDataCode128, BarcodeSymbology.UPCE, BarcodeWidth.Mode1, 40, true, 40);
    
        builder.AppendUnitFeed(32);
        builder.AppendUnitFeed(32);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs and each Command Specifications.

4.2.48. AppendBarcodeDataWithAlignment

Print command of the alignment barcode is generated and added to the command buffer.

  • Declaration

    void AppendBarcodeDataWithAlignment(IBuffer otherData, BarcodeSymbology symbology, BarcodeWidth width, int height, bool hri, AlignmentPosition position)
    void AppendBarcodeBytesWithAlignment(byte[] bytes, int length, BarcodeSymbology symbology, BarcodeWidth width, int height, bool hri, AlignmentPosition position)
    
  • Parameter

    Name

    Contents

    Type

    position

    Alignment position

    AlignmentPosition

    otherData
    bytes
    length

    Barcode data

    IBuffer
    byte[]
    int

    symbology

    Barcode symbology

    BarcodeSymbology

    width

    Barcode width

    BarcodeWidth

    height

    Barcode height. (Units : Dots)

    int

    hri

    Under-bar characters
    true … Valid
    false … Invalid

    bool

  • Return value

    None

  • Examples

    public static IBuffer CreateBarcodeData(Emulation emulation)
    {
        IBuffer otherDataCode128 = System.Text.Encoding.UTF8.GetBytes("{B0123456789").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendBarcodeDataWithAlignment(otherDataCode128, BarcodeSymbology.Code128, BarcodeWidth.Mode1, 40, true, AlignmentPosition.Center);
    
        builder.AppendUnitFeed(32);
    
        builder.AppendBarcodeDataWithAlignment(otherDataCode128, BarcodeSymbology.Code128, BarcodeWidth.Mode1, 40, true, AlignmentPosition.Right);
    
        builder.AppendUnitFeed(32);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs and each Command Specifications.

4.2.49. AppendPdf417Data

Print command of the PDF417 is generated and added to the command buffer.

  • Declaration

    void AppendPdf417Data(IBuffer otherData, int line, int column, Pdf417Level level, int module, int aspect)
    void AppendPdf417Bytes(byte[] bytes, int length, int line, int column, Pdf417Level level, int module, int aspect)
    
  • Parameter

    Name

    Contents

    Type

    otherData
    bytes
    length

    PDF417 data

    IBuffer
    byte[]
    int

    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 IBuffer CreatePdf417Data(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendPdf417Data(otherData, 0, 1, Pdf417Level.ECC0, 2, 2);
    
        builder.AppendUnitFeed(32);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs and each Command Specifications.

4.2.50. AppendPdf417DataWithAbsolutePosition

Print command of the absolute position PDF417 is generated and added to the command buffer.

  • Declaration

    void AppendPdf417DataWithAbsolutePosition(IBuffer otherData, int line, int column, Pdf417Level level, int module, int aspect, int position)
    void AppendPdf417BytesWithAbsolutePosition(byte[] bytes, int length, int line, int column, Pdf417Level level, int module, int aspect, int position)
    
  • Parameter

    Name

    Contents

    Type

    position

    Absolute position. (Units : Dots)

    int

    otherData
    bytes
    length

    PDF417 data

    IBuffer
    byte[]
    int

    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 IBuffer CreatePdf417Data(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendPdf417DataWithAbsolutePosition(otherData, 0, 1, Pdf417Level.ECC0, 2, 2, 40);
    
        builder.AppendUnitFeed(32);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs and each Command Specifications.

4.2.51. AppendPdf417DataWithAlignment

Print command of the alignment PDF417 is generated and added to the command buffer.

  • Declaration

    void AppendPdf417DataWithAlignment(IBuffer otherData, int line, int column, Pdf417Level level, int module, int aspect, AlignmentPosition position)
    void AppendPdf417BytesWithAlignment(byte[] bytes, int length, int line, int column, Pdf417Level level, int module, int aspect, AlignmentPosition position)
    
  • Parameter

    Name

    Contents

    Type

    position

    Alignment position

    AlignmentPosition

    otherData
    bytes
    length

    PDF417 data

    IBuffer
    byte[]
    int

    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 IBuffer CreatePdf417Data(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendPdf417DataWithAlignment(otherData, 0, 1, Pdf417Level.ECC0, 2, 2, AlignmentPosition.Center);
        builder.AppendUnitFeed(32);
    
        builder.AppendPdf417DataWithAlignment(otherData, 0, 1, Pdf417Level.ECC0, 2, 2, AlignmentPosition.Right);
        builder.AppendUnitFeed(32);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs and each Command Specifications.

4.2.52. AppendQrCodeData

Print command of the QR code is generated and added to the command buffer.

  • Declaration

    void AppendQrCodeData(IBuffer otherData, QrCodeModel model, QrCodeLevel level, int cell)
    void AppendQrCodeBytes(byte[] bytes, int length, QrCodeModel model, QrCodeLevel level, int cell)
    
  • Parameter

    Name

    Contents

    Type

    otherData
    bytes
    length

    QR code data

    IBuffer
    byte[]
    int

    model

    QR code model

    QrCodeModel

    level

    QR code mistake correction level

    QrCodeLevel

    cell

    QR code cell size

    int

  • Return value

    None

  • Examples

    public static IBuffer CreateQrCodeData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendQrCodeData(otherData, QrCodeModel.No2, QrCodeLevel.L, 2);
    
        builder.AppendUnitFeed(32);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs and each Command Specifications.

4.2.53. AppendQrCodeDataWithAbsolutePosition

Print command of the absolute position QR code is generated and added to the command buffer.

  • Declaration

    void AppendQrCodeDataWithAbsolutePosition(IBuffer otherData, QrCodeModel model, QrCodeLevel level, int cell, int position)
    void AppendQrCodeBytesWithAbsolutePosition(byte[] bytes, int length, QrCodeModel model, QrCodeLevel level, int cell, int position)
    
  • Parameter

    Name

    Contents

    Type

    position

    Absolute position. (Units : Dots)

    int

    otherData
    bytes
    length

    QR code data

    IBuffer
    byte[]
    int

    model

    QR code model

    QrCodeModel

    level

    QR code mistake correction level

    QrCodeLevel

    cell

    QR code cell size

    int

  • Return value

    None

  • Examples

    public static IBuffer CreateQrCodeData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendQrCodeDataWithAbsolutePosition(otherData, QrCodeModel.No2, QrCodeLevel.L, 4, 40);
    
        builder.AppendUnitFeed(32);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs and each Command Specifications.

4.2.54. AppendQrCodeDataWithAlignment

Print command of the alignment QR code is generated and added to the command buffer.

  • Declaration

    void AppendQrCodeDataWithAlignment(IBuffer otherData, QrCodeModel model, QrCodeLevel level, int cell, AlignmentPosition position)
    void AppendQrCodeBytesWithAlignment(byte[] bytes, int length, QrCodeModel model, QrCodeLevel level, int cell, AlignmentPosition position)
    
  • Parameter

    Name

    Contents

    Type

    position

    Alignment position

    AlignmentPosition

    otherData
    bytes
    length

    QR code data

    IBuffer
    byte[]
    int

    model

    QR code model

    QrCodeModel

    level

    QR code mistake correction level

    QrCodeLevel

    cell

    QR code cell size

    int

  • Return value

    None

  • Examples

    public static IBuffer CreateQrCodeData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendQrCodeDataWithAlignment(otherData, QrCodeModel.No2, QrCodeLevel.L, 4, AlignmentPosition.Center);
    
        builder.AppendUnitFeed(32);
    
        builder.AppendQrCodeDataWithAlignment(otherData, QrCodeModel.No2, QrCodeLevel.L, 4, AlignmentPosition.Right);
    
        builder.AppendUnitFeed(32);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs and each Command Specifications.

4.2.55. AppendBitmapAsync

Print command of the bitmap is generated and added to the command buffer.

  • Declaration

    IAsyncAction AppendBitmapAsync(Windows.Graphics.Imaging.BitmapDecoder bitmapDecoder, bool diffusion, uint width, bool bothScale, BitmapConverterRotation rotation)
    IAsyncAction AppendBitmapAsync(Windows.Graphics.Imaging.BitmapDecoder bitmapDecoder, bool diffusion, BitmapConverterRotation rotation)
    IAsyncAction AppendBitmapAsync(Windows.Graphics.Imaging.BitmapDecoder bitmapDecoder, bool diffusion, uint width, bool bothScale)
    IAsyncAction AppendBitmapAsync(Windows.Graphics.Imaging.BitmapDecoder bitmapDecoder, bool diffusion)
    
  • Parameter

    Name

    Contents

    Type

    bitmap

    Source bitmap object

    Windows.Graphics.Imaging.BitmapDecoder

    diffusion

    Random dither
    true … Valid
    false … Invalid

    bool

    width

    Bitmap width after conversion. (Units : Dots)

    int

    bothScale

    Height is changed according to the conversion rate of the width property.
    true … Valid
    false … Invalid

    bool

    rotation

    Rotation.

    BitmapConverterRotation

  • Return value

    None

  • Examples

    public static async Task<IBuffer> CreateBitmapDataAsync(Emulation emulation, uint width)
    {
        BitmapDecoder starLogoBitmapDecoder = await CreateCouponImageAsync("star_logo_image.png");
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("\n*Normal*\n").AsBuffer());
        await builder.AppendBitmapAsync(starLogoBitmapDecoder, true);
    
        builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("\n*width:Full, bothScale:true*\n").AsBuffer());
        await builder.AppendBitmapAsync(starLogoBitmapDecoder, true, width, true);
    
        builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("\n*width:Full, bothScale:false*\n").AsBuffer());
        await builder.AppendBitmapAsync(starLogoBitmapDecoder, true, width, false);
    
        builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("\n*Right180*\n").AsBuffer());
        await builder.AppendBitmapAsync(starLogoBitmapDecoder, true, BitmapConverterRotation.Rotate180);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.56. AppendBitmapWithAbsolutePositionAsync

Print command of the absolute position bitmap is generated and added to the command buffer.

  • Declaration

    IAsyncAction AppendBitmapWithAbsolutePositionAsync(Windows.Graphics.Imaging.BitmapDecoder bitmapDecoder, bool diffusion, uint width, bool bothScale, BitmapConverterRotation rotation, int position)
    IAsyncAction AppendBitmapWithAbsolutePositionAsync(Windows.Graphics.Imaging.BitmapDecoder bitmapDecoder, bool diffusion, BitmapConverterRotation rotation, int position)
    IAsyncAction AppendBitmapWithAbsolutePositionAsync(Windows.Graphics.Imaging.BitmapDecoder bitmapDecoder, bool diffusion, uint width, bool bothScale, int position)
    IAsyncAction AppendBitmapWithAbsolutePositionAsync(Windows.Graphics.Imaging.BitmapDecoder bitmapDecoder, bool diffusion, int position)
    
  • Parameter

    Name

    Contents

    Type

    position

    Absolute position. (Units : Dots)

    int

    bitmap

    Source bitmap object

    Windows.Graphics.Imaging.BitmapDecoder

    diffusion

    Random dither
    true … Valid
    false … Invalid

    bool

    width

    Bitmap width after conversion. (Units : Dots)

    int

    bothScale

    Height is changed according to the conversion rate of the width property.
    true … Valid
    false … Invalid

    bool

    rotation

    Rotation.

    BitmapConverterRotation

  • Return value

    None

  • Examples

    public static async Task<IBuffer> CreateBitmapDataAsync(Emulation emulation, uint width)
    {
        BitmapDecoder starLogoBitmapDecoder = await CreateCouponImageAsync("star_logo_image.png");
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("\n*Normal, AbsolutePosition:40*\n").AsBuffer());
        await builder.AppendBitmapWithAbsolutePositionAsync(starLogoBitmapDecoder, true, 40);
    
        builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("\n*Rotate180, AbsolutePosition:40*\n").AsBuffer());
        await builder.AppendBitmapWithAbsolutePositionAsync(starLogoBitmapDecoder, true, BitmapConverterRotation.Rotate180, 40);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.57. AppendBitmapWithAlignmentAsync

Print command of the alignment bitmap is generated and added to the command buffer.

  • Declaration

    IAsyncAction AppendBitmapWithAlignmentAsync(Windows.Graphics.Imaging.BitmapDecoder bitmapDecoder, bool diffusion, uint width, bool bothScale, BitmapConverterRotation rotation, AlignmentPosition position)
    IAsyncAction AppendBitmapWithAlignmentAsync(Windows.Graphics.Imaging.BitmapDecoder bitmapDecoder, bool diffusion, BitmapConverterRotation rotation, AlignmentPosition position)
    IAsyncAction AppendBitmapWithAlignmentAsync(Windows.Graphics.Imaging.BitmapDecoder bitmapDecoder, bool diffusion, uint width, bool bothScale, AlignmentPosition position)
    IAsyncAction AppendBitmapWithAlignmentAsync(Windows.Graphics.Imaging.BitmapDecoder bitmapDecoder, bool diffusion, AlignmentPosition position)
    
  • Parameter

    Name

    Contents

    Type

    position

    Alignment position

    AlignmentPosition

    bitmap

    Source bitmap object

    Windows.Graphics.Imaging.BitmapDecoder

    diffusion

    Random dither
    true … Valid
    false … Invalid

    bool

    width

    Bitmap width after conversion. (Units : Dots)

    int

    bothScale

    Height is changed according to the conversion rate of the width property.
    true … Valid
    false … Invalid

    bool

    rotation

    Rotation.

    BitmapConverterRotation

  • Return value

    None

  • Examples

    public static async Task<IBuffer> CreateBitmapDataAsync(Emulation emulation, uint width)
    {
        BitmapDecoder starLogoBitmapDecoder = await CreateCouponImageAsync("star_logo_image.png");
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("\n*Normal, AbsolutePosition:40*\n").AsBuffer());
        await builder.AppendBitmapWithAbsolutePositionAsync(starLogoBitmapDecoder, true, 40);
    
        builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("\n*Rotate180, AbsolutePosition:40*\n").AsBuffer());
        await builder.AppendBitmapWithAbsolutePositionAsync(starLogoBitmapDecoder, true, BitmapConverterRotation.Rotate180, 40);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.58. AppendBlackMark

added in version 1.2.0

Black mark detection command is generated and added to the command buffer.

  • Declaration

    void AppendBlackMark(BlackMarkType type);
    
  • Parameter

    Name

    Contents

    Type

    type

    Black mark detection

    BlackMarkType

  • Return value

    None

  • Examples

    public static IBuffer CreateBlackMarkData(Emulation emulation, BlackMarkType type)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendBlackMark(type);
    
        builder.AppendData(otherData);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        //builder.AppendBlackMark(BlackMarkType.Invalid);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.59. AppendLabel

added in version 1.11.0

Gap detection command for die-cut label paper, etc is generated and added to the command buffer.

  • Declaration

    void AppendLabelType(LabelType type);
    
  • Parameter

    Name

    Contents

    Type

    type

    Gap detection

    LabelType

  • Return value

    None

  • Examples

    public static IBuffer CreateLabelData(Emulation emulation, LabelType type)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendLabel(type);
    
        builder.AppendData(otherData);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        //builder.AppendLabel(LabelType.Invalid);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.60. BeginPageMode

added in version 1.2.0

Begin page mode command is generated and added to the command buffer.

  • Declaration

    void BeginPageMode(PageModePrintRegion printRegion, BitmapConverterRotation
    
  • Parameter

    Name

    Contents

    Type

    rect

    Location and size. (Units : Dots)

    PageModePrintRegion

    rotation

    Print direction

    BitmapConverterRotation

  • Return value

    None

  • Examples

    public static IBuffer CreatePageModeData(Emulation emulation, int width)
    {
    
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        int height = 30 * 8; //30mm
    
        PageModePrintRegion printRegion = null;
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("\n*Rotate180*\n").AsBuffer());
    
        printRegion = new PageModePrintRegion(0, 0, width, height);
    
        builder.BeginPageMode(printRegion, BitmapConverterRotation.Normal);
    
        builder.AppendPageModeVerticalAbsolutePosition(height / 2);
    
        builder.AppendDataWithAbsolutePosition(otherData, width / 2);
    
        builder.EndPageMode();
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.61. EndPageMode

added in version 1.2.0

End page mode command is generated and added to the command buffer.

  • Declaration

    void EndPageMode();
    
  • Parameter

    None

  • Return value

    None

  • Examples

    public static IBuffer CreatePageModeData(Emulation emulation, int width)
    {
    
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        int height = 30 * 8; //30mm
    
        PageModePrintRegion printRegion = null;
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("\n*Rotate180*\n").AsBuffer());
    
        printRegion = new PageModePrintRegion(0, 0, width, height);
    
        builder.BeginPageMode(printRegion, BitmapConverterRotation.Normal);
    
        builder.AppendPageModeVerticalAbsolutePosition(height / 2);
    
        builder.AppendDataWithAbsolutePosition(otherData, width / 2);
    
        builder.EndPageMode();
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.62. AppendPageModeVerticalAbsolutePosition

added in version 1.2.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 IBuffer CreatePageModeData(Emulation emulation, int width)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        int height = 30 * 8; //30mm
    
        PageModePrintRegion printRegion = null;
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("\n*Rotate180*\n").AsBuffer());
    
        printRegion = new PageModePrintRegion(0, 0, width, height);
    
        builder.BeginPageMode(printRegion, BitmapConverterRotation.Normal);
    
        builder.AppendPageModeVerticalAbsolutePosition(height / 2);
    
        builder.AppendDataWithAbsolutePosition(otherData, width / 2);
    
        builder.EndPageMode();
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.63. AppendPageModeRotation

added in version 1.2.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 IBuffer CreatePageModeData(Emulation emulation, int width)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.\n").AsBuffer();
    
        int height = 30 * 8; //30mm
    
        PageModePrintRegion printRegion = null;
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("\n*Rotate180*\n").AsBuffer());
    
        printRegion = new PageModePrintRegion(0, 0, width, height);
    
        builder.BeginPageMode(printRegion, BitmapConverterRotation.Normal);
    
        builder.AppendPageModeVerticalAbsolutePosition(height / 2);
    
        builder.AppendDataWithAbsolutePosition(otherData, width / 2);
    
        builder.AppendPageModeRotation(BitmapConverterRotation.Rotate180);
    
        builder.AppendPageModeVerticalAbsolutePosition(height / 2);
    
        builder.AppendDataWithAbsolutePosition(otherData, width / 2);
    
        builder.EndPageMode();
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.64. AppendPrintableArea

added in version 1.4.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 mC-Label3 mPOP FVP10 TSP100IV TSP100IV SK TSP100IIIW TSP100IIIBITSP100LAN TSP650II TSP650IISK TSP700II TSP800IISM-S210i SM-S220i SM-S230i SM-T300i/T300 SM-T400i BSC10II BSC10 SM-L200 SM-L300 SP700
StarPRNT StarPRNT StarPRNT StarPRNT StarLine StarPRNT StarPRNT StarGraphic StarGraphic StarGraphic StarLine StarLine StarLine StarLine StarPRNT EscPosMobile StarPRNT EscPosMobile StarPRNT EscPosMobile StarPRNT EscPosMobile StarPRNT EscPosMobile StarPRNT EscPos StarPRNT StarPRNT StarDotImpact

Standard

48 72[1] 72[1] 48 72[1] 72[1] 72[1] 72[1] 72[1] 72[1] 72[1] 72[1] 72[1] 104[2] - - - - - - - - - - 72[1] 64[1][3] - 72[1] 63

Type1

54 - 54 54 52.5 51 51 51 51 51 - 34.5 52.5 - - - - - - - - - - - 51 - - - 48

Type2

- 48 48 - - 48 48 - - - - 32 80[1] 72 - - - - - - - - - - 48 - - - 60

Type3

50.8 50.8 50.8 50.8 50.8 50.8 50.8 - - - 50.8 50.8 50.8 - - - - - - - - - - - 50.8 45[3] - 50.8 45

Type4

- - - - 52 - - - - - - - 52 - - - - - - - - - - - - - - - 57
[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.)

Note

If you want to set a print area other than those in the table above, use AppendRawData and send a print area setting command to the printer.
For details on the print area setting commands, please refer to the each Command Specifications.
  • Examples

    public static async Task<IBuffer> CreatePrintableAreaData(Emulation emulation, PrintableAreaType type)
    {
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        BitmapDecoder starLogoBitmapDecoder = await CreateCouponImageAsync("PrintableArea_image.png");
    
        IBuffer otherData1 = System.Text.Encoding.UTF8.GetBytes("123456789").AsBuffer();
        IBuffer otherData2 = System.Text.Encoding.UTF8.GetBytes("0").AsBuffer();
    
        builder.BeginDocument();
    
        builder.AppendPrintableArea(type);
    
        switch (type)
        {
            default:
            case PrintableAreaType.Standard:
            builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("*Standard*\n").AsBuffer());
            break;
            case PrintableAreaType.Type1:
            builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("*Type1*\n").AsBuffer());
            break;
            case PrintableAreaType.Type2:
            builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("*Type2*\n").AsBuffer());
            break;
            case PrintableAreaType.Type3:
            builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("*Type3*\n").AsBuffer());
            break;
            case PrintableAreaType.Type4:
            builder.AppendData(Encoding.GetEncoding("ASCII").GetBytes("*Type4*\n").AsBuffer());
            break;
        }
    
        await builder.AppendBitmapAsync(starLogoBitmapDecoder, true);
    
        builder.AppendData(otherData1);
        builder.AppendDataWithInvert(otherData2);
        builder.AppendData(otherData1);
        builder.AppendDataWithInvert(otherData2);
        builder.AppendData(otherData1);
        builder.AppendDataWithInvert(otherData2);
        builder.AppendData(otherData1);
        builder.AppendDataWithInvert(otherData2);
        builder.AppendData(otherData1);
        builder.AppendDataWithInvert(otherData2);
        builder.AppendData(otherData1);
        builder.AppendDataWithInvert(otherData2);
        builder.AppendData(otherData1);
        builder.AppendDataWithInvert(otherData2);
        builder.AppendData(otherData1);
        builder.AppendDataWithInvert(otherData2);
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.2.65. AppendCjkUnifiedIdeographFont

added in version 1.8.0

A command to set the UTF-8 CJK Unified Ideograph font is generated and added to the command buffer.

  • Declaration

    void AppendCjkUnifiedIdeographFont (params CjkUnifiedIdeographFont[] fonts)
    
  • Parameter

    Name

    Contents

    Type

    font

    CJK Unified Ideograph font in UTF-8
    When 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 override void Append3inchTextReceiptData(StarIO_Extension.ICommandBuilder builder, bool utf8)
    {
        string encoding = "UTF-8";
    
        builder.AppendCodePage(CodePageType.UTF8);
    
        builder.AppendCharacterSpace(0);
    
        builder.AppendAlignment(AlignmentPosition.Center);
    
        builder.AppendData(Encoding.GetEncoding(encoding).GetBytes("2017 / 5 / 15 AM 10:00\n").AsBuffer());
    
        builder.AppendMultiple(2, 2);
    
        // This function is supported by TSP650II(JP2/TW models only) with F/W version 4.0 or later and 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.AppendData(Encoding.GetEncoding(encoding).GetBytes("受付票 ").AsBuffer());
    
        builder.AppendCjkUnifiedIdeographFont(CjkUnifiedIdeographFont.TraditionalChinese);
        builder.AppendData(Encoding.GetEncoding(encoding).GetBytes("排號單\n").AsBuffer());
    
        builder.AppendCjkUnifiedIdeographFont(CjkUnifiedIdeographFont.SimplifiedChinese);
        builder.AppendData(Encoding.GetEncoding(encoding).GetBytes("排号单 ").AsBuffer());
    
        builder.AppendCjkUnifiedIdeographFont(CjkUnifiedIdeographFont.Hangul);
        builder.AppendData(Encoding.GetEncoding(encoding).GetBytes("접수표\n\n").AsBuffer());
    
        builder.AppendMultiple(1, 1);
    
        builder.AppendCjkUnifiedIdeographFont();
    
        builder.AppendDataWithMultiple(Encoding.GetEncoding(encoding).GetBytes("1\n").AsBuffer(), 6, 6);
    
        builder.AppendData(Encoding.GetEncoding(encoding).GetBytes("------------------------------------------\n").AsBuffer());
    
        builder.AppendCjkUnifiedIdeographFont(CjkUnifiedIdeographFont.Japanese);
    
        builder.AppendData(Encoding.GetEncoding(encoding).GetBytes("ご本人がお持ちください。\n").AsBuffer());
        builder.AppendData(Encoding.GetEncoding(encoding).GetBytes("※紛失しないようにご注意ください。 \n").AsBuffer());
    }
    

    Refer to UTF8MultiLanguageReceiptsImple.cs.

4.2.66. AppendHoldPrint

added in version 1.10.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 ( BeginCheckedBlockAsync method is blocked until paper is removed). See also the Example on next page.

  1. Disable the hold print control by the printer firmware using the command generated by this method.

  2. Enable hold print status using the command generated by the AppendPaperPresentStatus method.

  • Examples

    public static List<IBuffer> CreateHoldPrintData(Emulation emulation, bool[] isHoldArray)
    {
        List<IBuffer> commandList = new List<IBuffer>();
    
        for (int i = 0; i < isHoldArray.Length; i++)
        {
            ICommandBuilder builder = StarIoExt.CreateCommandBuilder(emulation);
    
            builder.BeginDocument();
    
            // 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.
            builder.AppendAlignment(AlignmentPosition.Center);
    
            builder.AppendData(Encoding.ASCII.GetBytes("\n------------------------------------\n\n\n\n\n\n").AsBuffer());
    
            builder.AppendMultiple(3, 3);
    
            builder.AppendData(Encoding.ASCII.GetBytes("Page ").AsBuffer());
            builder.AppendData(Encoding.ASCII.GetBytes((i + 1).ToString()).AsBuffer());
    
            builder.AppendMultiple(1, 1);
    
            builder.AppendData(Encoding.ASCII.GetBytes("\n\n\n\n\n----------------------------------\n").AsBuffer());
    
            builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
            builder.EndDocument();
    
            commandList.Add(builder.GetCommands());
        }
    
        return commandList;
    }
    

4.2.67. AppendPaperPresentStatus

added in version 1.10.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

4.2.68. GetCommands

Gets the command buffer.

  • Declaration

    IBuffer GetCommands ()
    
  • Parameter

    None

  • Return value

    Contents

    Type

    Command buffer

    IBuffer

  • Examples

    public static IBuffer CreateGenericData(Emulation emulation)
    {
        IBuffer otherData = System.Text.Encoding.UTF8.GetBytes("Hello World.").AsBuffer();
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendData(otherData); builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to ApiFunctions.cs.

4.3. PageModePrintRegion

Class of print area in page mode.

  • Declaration

    public sealed class PageModePrintRegion
    
  • Constructor

    Name

    Contents

    PageModePrintRegion

    Create PageModePrintRegion object.

  • Property

    None

  • Method

    None

4.3.1. PageModePrintRegion

Create PageModePrintRegion object.

  • Syntax

    public PageModePrintRegion(int x, int y, int width, int height)
    
  • Parameter

    Name

    Contents

    Type

    x

    Horizontal direction starting point

    int

    y

    Vertical direction starting point

    int

    width

    Horizontal direction length

    int

    weight

    Vertical direction length

    int

  • Return value

    Contents

    Type

    PageModePrintRegion object

    PageModePrintRegion

  • Examples

    PageModePrintRegion printRegion = new PageModePrintRegion(0, 0, width, height);
    

    Refer to ApiFunctions.cs.