4.2. ICommandBuilder

プリンタ制御用コマンドを生成する機能を提供します。

  • メソッド

    名称

    説明

    BeginDocument

    ドキュメント開始コマンドを生成し、コマンドバッファに追加します。

    EndDocument

    ドキュメント終了コマンドを生成し、コマンドバッファに追加します。

    AppendInitialization

    初期化コマンドを生成し、コマンドバッファに追加します。

    AppendData

    データ(テキストやコマンド)を、コマンドバッファに追加します。

    AppendRawData

    生のデータ(テキストやコマンド)を、コマンドバッファに追加します。

    AppendFontStyle

    フォントスタイル指定コマンドを生成し、コマンドバッファに追加します。

    AppendCodePage

    コードページ指定コマンドを生成し、コマンドバッファに追加します。

    AppendInternational

    国際文字指定コマンドを生成し、コマンドバッファに追加します。

    AppendLineFeed

    行単位の用紙送りコマンドを生成し、コマンドバッファに追加します。

    AppendUnitFeed

    1ドットライン単位の用紙送りコマンドを生成し、コマンドバッファに追加します。

    AppendCharacterSpace

    文字間スペース設定コマンドを生成し、コマンドバッファに追加します。

    AppendLineSpace

    行間スペース設定コマンドを生成し、コマンドバッファに追加します。

    AppendTopMargin

    トップマージン設定コマンドを生成し、コマンドバッファに追加します。

    AppendEmphasis

    強調指定コマンドを生成し、コマンドバッファに追加します。

    AppendInvert

    白黒反転指定コマンドを生成し、コマンドバッファに追加します。

    AppendMultiple

    拡大指定コマンドを生成し、コマンドバッファに追加します。

    AppendUnderLine

    アンダーライン指定コマンドを生成し、コマンドバッファに追加します。

    AppendLogo

    ロゴ印刷コマンドを生成し、コマンドバッファに追加します。

    AppendAbsolutePosition

    絶対位置指定コマンドを生成し、コマンドバッファに追加します。

    AppendAlignment

    位置揃え指定コマンドを生成し、コマンドバッファに追加します。

    AppendHorizontalTabPosition

    クリアコマンドを生成し、コマンドバッファに追加します。

    AppendCutPaper

    用紙カットコマンドを生成し、コマンドバッファに追加します。

    AppendPeripheral

    キャッシュドロアー駆動コマンドを生成し、コマンドバッファに追加します。

    AppendSound

    サウンド/ブザー駆動コマンドを生成し、コマンドバッファに追加します。

    AppendBarcodeData

    バーコード印刷コマンドを生成し、コマンドバッファに追加します。

    AppendBarcodeDataWithAbsolutePosition

    絶対位置指定バーコード印刷コマンドを生成し、コマンドバッファに追加します。

    AppendBarcodeDataWithAlignment

    位置揃えバーコード印刷コマンドを生成し、コマンドバッファに追加します。

    AppendPdf417Data

    PDF417印刷コマンドを生成し、コマンドバッファに追加します。

    AppendPdf417DataWithAbsolutePosition

    絶対位置指定PDF417印刷コマンドを生成し、コマンドバッファに追加します。

    AppendPdf417DataWithAlignment

    位置揃えPDF417印刷コマンドを生成し、コマンドバッファに追加します。

    AppendQrCodeData

    QRコード印刷コマンドを生成し、コマンドバッファに追加します。

    AppendQrCodeDataWithAbsolutePosition

    絶対位置指定QRコード印刷コマンドを生成し、コマンドバッファに追加します。

    AppendQrCodeDataWithAlignment

    位置揃えQRコード印刷コマンドを生成し、コマンドバッファに追加します。

    AppendBitmapAsync

    ビットマップ印刷コマンドを生成し、コマンドバッファに追加します。

    AppendBitmapWithAbsolutePositionAsync

    絶対位置指定ビットマップ印刷コマンドを生成し、コマンドバッファに追加します。

    AppendBitmapWithAlignmentAsync

    位置揃えビットマップ印刷コマンドを生成し、コマンドバッファに追加します。

    AppendBlackMark

    ブラックマーク検出コマンドを生成し、コマンドバッファに追加します。

    AppendLabel

    ダイカットラベル紙等のギャップ検出指定コマンドを生成し、コマンドバッファに追加します。

    BeginPageMode

    ページモード開始コマンドを生成し、コマンドバッファに追加します。

    EndPageMode

    ページモード終了コマンドを生成し、コマンドバッファに追加します。

    AppendPageModeVerticalAbsolutePosition

    ページモードの縦方向絶対位置指定コマンドを生成し、コマンドバッファに追加します。

    AppendPageModeRotation

    ページモード印刷方向コマンドを生成し、コマンドバッファに追加します。

    AppendPrintableArea

    印字領域設定コマンドを生成し、コマンドバッファに追加します。

    AppendCjkUnifiedIdeographFont

    UTF-8におけるCJK統合漢字のフォント設定コマンドを生成し、コマンドバッファに追加します。

    AppendHoldPrint

    プリンターファームウェアによる用紙保持制御の指定コマンドを生成し、コマンドバッファに追加します。

    AppendPaperPresentStatus

    用紙保持ステータス指定コマンドを生成し、コマンドバッファに追加します。

    GetCommands

    コマンドバッファを取得します。

各モデルにおいて機能するメソッドは以下のとおりです。

モデル/エミュレーション

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 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 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]

データ(テキストやコマンド)の追加は行わず、1ドットライン単位の用紙送りコマンドの追加のみ行う

[2]

トップマージン設定が10mm以下の場合は、印字用紙長さ(カット長)が50mmを超えないようにすること。 (カットした用紙が残っている場合は、用紙詰まりが発生する可能性がある。カットした用紙を取り除いた状態では印字用紙長さの制限はなし)

[3]

MCP30は非対応

[5]

用紙カットを行わない

[6]

印字されるバーコードが正常に読み取れることを実環境で確認すること。

[7]

常に左揃え

[8]

縦方向の最大印刷可能領域は30cm (2400dot)まで

[9]

用紙表面のブラックマークのみ有効無効設定可能。用紙裏面のブラックマーク設定はプリンター側で有効にする必要あり(SM-T300i/T300は用紙裏面ブラックマーク非対応)。設定方法はハードウェアマニュアル参照のこと。

[10]

ライブラリバージョン 1.9.0 以降が必要。

[11]

プリンター側でブラックマーク設定を有効にする必要有り。設定方法はハードウェアマニュアル参照のこと。

[12]

JP2/TWモデルのファームウェアバージョン4.0以降が必要。

[13]

ファームウェアバージョン7.1以降が必要。

4.2.1. InitializationType

初期化指定定数です。

  • 宣言

    public enum InitializationType {
        Command
    }
    
  • 定数

    名称

    説明

    Command

    コマンド初期化

4.2.2. FontStyleType

フォントスタイル指定定数です。

  • 宣言

    public enum FontStyleType {
        A,
        B
    }
    
  • 定数

    名称

    説明

    A

    フォントA(12 x 24ドット)/ 7 x 9フォント(ハーフドット)

    B

    フォントB( 9 x 24ドット)/ 5 x 9フォント(2P-1)

4.2.3. CodePageType

コードページ指定定数です。

  • 宣言

    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
    }
    
  • 定数

    名称

    説明

    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

国際文字指定定数です。

  • 宣言

    public enum InternationalType {
        USA,
        France,
        Germany,
        UK,
        Denmark,
        Sweden,
        Italy,
        Spain,
        Japan,
        Norway,
        Denmark2,
        Spain2,
        LatinAmerica,
        Korea,
        Ireland,
        Legal
    }
    
  • 定数

    名称

    説明

    USA

    アメリカ

    France

    フランス

    Germany

    ドイツ

    UK

    イギリス

    Denmark

    デンマーク

    Sweden

    スウェーデン

    Italy

    イタリア

    Spain

    スペイン

    Japan

    日本

    Norway

    ノルウェー

    Denmark2

    デンマーク II

    Spain2

    スペイン II

    LatinAmerica

    ラテンアメリカ

    Korea

    韓国

    Ireland

    アイルランド

    Legal

    Legal

4.2.5. LogoSize

ロゴサイズ指定定数です。

  • 宣言

    public enum LogoSize {
        Normal,
        DoubleWidth,
        DoubleHeight,
        DoubleWidthDoubleHeight
    }
    
  • 定数

    名称

    説明

    Normal

    ノーマルモード

    DoubleWidth

    横2倍モード

    DoubleHeight

    縦2倍モード

    DoubleWidthDoubleHeight

    縦2倍、横2倍モード

4.2.6. AlignmentPosition

位置揃え指定定数です。

  • 宣言

    public enum AlignmentPosition {
        Left,
        Center,
        Right
    }
    
  • 定数

    名称

    説明

    Left

    左揃え

    Center

    中心揃え

    Right

    右揃え

4.2.7. CutPaperAction

用紙カット指定定数です。

  • 宣言

    public enum CutPaperAction {
        FullCut,
        PartialCut,
        FullCutWithFeed,
        PartialCutWithFeed
    }
    
  • 定数

    名称

    説明

    FullCut

    フルカット

    PartialCut

    パーシャルカット

    FullCutWithFeed

    用紙送り付きフルカット

    PartialCutWithFeed

    用紙送り付きパーシャルカット

4.2.8. PeripheralChannel

キャッシュドロアーチャネル指定定数です。

  • 宣言

    public enum PeripheralChannel {
        No1,
        No2
    }
    
  • 定数

    名称

    説明

    No1

    チャネル1

    No2

    チャネル2

4.2.9. SoundChannel

サウンド/ブザーチャネル指定定数です。

  • 宣言

    public enum SoundChannel {
        No1,
        No2
    }
    
  • 定数

    名称

    説明

    No1

    チャネル1

    No2

    チャネル2

4.2.10. BarcodeSymbology

バーコードシンボル指定定数です。

  • 宣言

    public enum BarcodeSymbology {
        UPCE,
        UPCA,
        JAN8,
        JAN13,
        Code39,
        ITF,
        Code128,
        Code93,
        NW7
    }
    
  • 定数

    名称

    説明

    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

バーコード幅指定定数です。

ExtModeを指定することで、コマンド仕様に準拠したバーコードモードが指定されます。

  • 宣言

    public enum BarcodeWidth {
        Mode1,
        Mode2,
        Mode3,
        Mode4,
        Mode5,
        Mode6,
        Mode7,
        Mode8,
        Mode9,
        ExtMode1,
        ExtMode2,
        ExtMode3,
        ExtMode4,
        ExtMode5,
        ExtMode6,
        ExtMode7,
        ExtMode8,
        ExtMode9
    }
    
  • 定数

    名称

    説明

    ライブラリバージョン

    Mode1

    モード1

    1.1.0+

    Mode2

    モード2

    1.1.0+

    Mode3

    モード3

    1.1.0+

    Mode4

    モード4

    1.1.0+

    Mode5

    モード5

    1.1.0+

    Mode6

    モード6

    1.1.0+

    Mode7

    モード7

    1.1.0+

    Mode8

    モード8

    1.1.0+

    Mode9

    モード9

    1.1.0+

    ExtMode1

    Extモード1

    1.8.0+

    ExtMode2

    Extモード2

    1.8.0+

    ExtMode3

    Extモード3

    1.8.0+

    ExtMode4

    Extモード4

    1.8.0+

    ExtMode5

    Extモード5

    1.8.0+

    ExtMode6

    Extモード6

    1.8.0+

    ExtMode7

    Extモード7

    1.8.0+

    ExtMode8

    Extモード8

    1.8.0+

    ExtMode9

    Extモード9

    1.8.0+

4.2.12. Pdf417Level

PDF417 ECC(セキュリティレベル)指定定数です。

  • 宣言

    public enum Pdf417Level {
        ECC0,
        ECC1,
        ECC2,
        ECC3,
        ECC4,
        ECC5,
        ECC6,
        ECC7,
        ECC8
    }
    
  • 定数

    名称

    説明

    ECC0

    セキュリティレベル0

    ECC1

    セキュリティレベル1

    ECC2

    セキュリティレベル2

    ECC3

    セキュリティレベル3

    ECC4

    セキュリティレベル4

    ECC5

    セキュリティレベル5

    ECC6

    セキュリティレベル6

    ECC7

    セキュリティレベル7

    ECC8

    セキュリティレベル8

4.2.13. QrCodeModel

QRコードモデル指定定数です。

  • 宣言

    public enum QrCodeModel {
        No1,
        No2
    }
    
  • 定数

    名称

    説明

    No1

    モデル1

    No2

    モデル2

4.2.14. QrCodeLevel

QR コード誤り訂正レベル指定定数です。

  • 宣言

    public enum QrCodeLevel {
        L,
        M,
        Q,
        H
    }
    
  • 定数

    名称

    説明

    L

    誤り訂正レベルL

    M

    誤り訂正レベルM

    Q

    誤り訂正レベルQ

    H

    誤り訂正レベルH

4.2.15. BitmapConverterRotation

ビットマップ回転指定定数です。

  • 宣言

    public enum BitmapConverterRotation {
        Normal,
        Right90,
        Left90,
        Rotate180
    }
    
  • 定数

    名称

    説明

    Normal

    回転なし

    Right90

    右90度 回転

    Left90

    左90度 回転

    Rotate180

    180度 回転

4.2.16. BlackMarkType

added in version 1.2.0

ブラックマーク検出指定定数です。

  • 宣言

    public enum BlackMarkType {
        Invalid,
        Valid,
        ValidWithDetection
    }
    
  • 定数

    名称

    説明

    Invalid

    ブラックマーク検出無効

    Valid

    ブラックマーク検出有効

    ValidWithDetection

    ブラックマーク検出有効 + 電源投入時のブラックマーク検出動作有効

4.2.17. LabelType

added in version 1.11.0

ダイカットラベル紙等のギャップ検出指定定数です。

  • 宣言

    public enum LabelType {
        Invalid,
        Valid,
        ValidWithDetection
    }
    
    • 定数

      名称

      説明

      Invalid

      ギャップ検出無効

      Valid

      ギャップ検出有効

      ValidWithDetection

      ギャップ検出有効 + 電源投入時のギャップ検出動作有効

4.2.18. PrintableAreaType

added in version 1.4.0

印字領域タイプ指定定数です。

  • 宣言

    public enum PrintableAreaType {
        Standard,
        Type1,
        Type2,
        Type3,
        Type4
    }
    
  • 定数

    名称

    説明

    Standard

    標準タイプ

    Type1

    タイプ1

    Type2

    タイプ2

    Type3

    タイプ3

    Type4

    タイプ4

4.2.19. CjkUnifiedIdeographFont

added in version 1.8.0

CJK統合漢字のフォント指定定数です。

  • 宣言

    public enum CjkUnifiedIdeographFont {
        Japanese,
        SimplifiedChinese,
        TraditionalChinese,
        Hangul
    }
    
  • 定数

    名称

    説明

    Japanese

    日本語フォント

    SimplifiedChinese

    簡体字中国語フォント

    TraditionalChinese

    繁体字中国語フォント

    Hangul

    韓国語フォント

4.2.20. HoldPrintType

added in version 1.10.0

用紙保持制御の指定定数です。

  • 宣言

    public enum HoldPrintType
    {
        Invalid,
        Valid,
        Default
    }
    
  • 定数

    名称

    説明

    Invalid

    用紙保持制御無効

    Valid

    用紙保持制御有効

    Default

    メモリスイッチ設定に従う

4.2.21. PaperPresentStatusType

added in version 1.10.0

用紙保持ステータス指定定数です。

  • 宣言

    public enum PaperPresentStatusType
    {
        Invalid,
        Valid,
        Default
    }
    
  • 定数

    名称

    説明

    Invalid

    用紙保持ステータス無効

    Valid

    用紙保持ステータス有効

    Default

    メモリスイッチ設定に従う

4.2.22. BeginDocument

ドキュメント開始コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void BeginDocument();
    
  • 引数

    なし

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs を参照ください。

4.2.23. EndDocument

ドキュメント終了コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void EndDocument();
    
  • 引数

    なし

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs を参照ください。

4.2.24. AppendInitialization

初期化コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void appendInitialization(InitializationType type);
    
  • 引数

    名称

    説明

    type

    初期化タイプ

    InitializationType

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs を参照ください。

4.2.25. AppendData

データ(テキストやコマンド)を、コマンドバッファに追加します。

  • 宣言

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

    名称

    説明

    otherData
    data
    bytes
    length

    データ(テキストやコマンド)

    IBuffer
    byte
    byte[]
    int
  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.26. AppendRawData

生のデータ(テキストやコマンド)を、コマンドバッファに追加します。

  • 宣言

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

    名称

    説明

    otherData
    data
    bytes
    length

    生のデータ(テキストやコマンド)

    IBuffer
    byte
    byte[]
    int
  • 戻り値

    なし

  • 実装例

    public static IBuffer CreateGenericData(Emulation emulation)
    {
        var image = await GetPrintImageAsync("RasterReceiptImage.png");
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

4.2.27. AppendFontStyle

フォントスタイル指定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendFontStyle(FontStyleType type);
    
  • 引数

    名称

    説明

    type

    フォントスタイル

    FontStyleType

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.28. AppendCodePage

コードページ指定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendCodePage(CodePageType type);
    
  • 引数

    名称

    説明

    type

    コードページ

    CodePageType

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.29. AppendInternational

国際文字指定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendInternational(InternationalType type);
    
  • 引数

    名称

    説明

    type

    国際文字

    InternationalType

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.30. AppendLineFeed

行単位の用紙送りコマンドを生成し、コマンドバッファに追加します。

  • 宣言

    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)
    
  • 引数

    名称

    説明

    line

    紙送り量(行数単位)

    int

    otherData
    bytes
    length

    データ(テキストやコマンド)

    IBuffer
    byte[]
    int
  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.31. AppendUnitFeed

1ドットライン単位の用紙送りコマンドを生成し、コマンドバッファに追加します。

  • 宣言

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

    名称

    説明

    unit

    紙送り量(ドット数単位)

    int

    otherData
    bytes
    length

    データ(テキストやコマンド)

    IBuffer
    byte[]
    int
  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.32. AppendCharacterSpace

文字間スペース設定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendCharacterSpace(int space);
    
  • 引数

    名称

    説明

    space

    文字間スペース(ドット数単位)

    int

  • 戻り値

    なし

重要

日本語、中国語簡体字、中国語繁体字、韓国語(DBCS)では、文字間スペースが設定値の2倍になります。

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.33. AppendLineSpace

行間スペース設定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendLineSpace(int lineSpace);
    
  • 引数

    名称

    説明

    lineSpace

    行間スペース(ドット数単位)

    int

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.34. AppendTopMargin

added in version 1.4.0

トップマージン設定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendTopMargin(int margin);
    
  • 引数

    名称

    説明

    margin

    トップマージン(1ミリメートル単位)

    int

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.35. AppendEmphasis

強調指定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendEmphasis(bool emphasis)
    void AppendDataWithEmphasis(IBuffer otherData)
    void AppendBytesWithEmphasis(byte[] bytes, int length)
    
  • 引数

    名称

    説明

    emphasis

    強調
    true ... 強調設定
    false ... 強調解除

    bool

    otherData
    bytes
    length

    データ(テキストやコマンド)

    IBuffer
    byte[]
    int
  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.36. AppendInvert

白黒反転指定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

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

    名称

    説明

    invert

    白黒反転
    true ... 白黒反転設定
    false ... 白黒反転解除

    bool

    otherData
    bytes
    length

    データ(テキストやコマンド)

    IBuffer
    byte[]
    int
  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.37. AppendMultiple

拡大指定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    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)
    
  • 引数

    名称

    説明

    width

    横倍率

    int

    height

    縦倍率

    int

    otherData
    bytes
    length

    データ(テキストやコマンド)

    IBuffer
    byte[]
    int
  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs 各コマンド仕様書を参照ください。

4.2.38. AppendUnderLine

アンダーライン指定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendUnderLine(bool underLine)
    void AppendDataWithUnderLine(IBuffer otherData)
    void AppendBytesWithUnderLine(byte[] bytes, int length)
    
  • 引数

    名称

    説明

    underLine

    アンダーライン
    true ... アンダーライン設定
    false ... アンダーライン解除

    bool

    otherData
    bytes
    length

    データ(テキストやコマンド)

    IBuffer
    byte[]
    int
  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.40. AppendAbsolutePosition

絶対位置指定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

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

    名称

    説明

    position

    絶対位置(ドット数単位)

    int

    otherData
    bytes
    length

    データ(テキストやコマンド)

    IBuffer
    byte[]
    int
  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.41. AppendAlignment

位置揃え指定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

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

    名称

    説明

    position

    位置揃え

    AlignmentPosition

    otherData
    bytes
    length

    データ(テキストやコマンド)

    IBuffer
    byte[]
    int
  • 戻り値

    なし

重要

AppendBitmapAsyncAppendBarcodeDataAppendQrCodeDataAppendPdf417Data メソッドと組み合わせての位置揃えはできません。 それぞれ AppendBitmapWithAlignmentAsyncAppendBarcodeDataWithAlignmentAppendQrCodeDataWithAlignmentAppendPdf417DataWithAlignment メソッドをご利用ください。

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.42. AppendHorizontalTabPosition

added in version 1.4.0

水平タブ設定/クリアコマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendHorizontalTabPosition(int[] positions);
    
  • 引数

    名称

    説明

    positions

    水平タブ位置(ANK文字ピッチ単位)の配列
    null もしくは空の配列を指定した場合、現在設定されている水平タブ位置をすべてクリアします。

    int[]

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs を参照ください。

4.2.43. AppendCutPaper

用紙カットコマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendCutPaper(CutPaperAction action);
    
  • 引数

    名称

    説明

    action

    用紙カット

    CutPaperAction

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs を参照ください。

4.2.44. AppendPeripheral

キャッシュドロアー駆動コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendPeripheral(PeripheralChannel channel);
    void AppendPeripheral(PeripheralChannel channel, int time);
    
  • 引数

    名称

    説明

    channel

    キャッシュドロアーチャネル

    PeripheralChannel

    time

    駆動時間(1ミリ秒単位)
    ※チャネル1のみ有効

    int

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.45. AppendSound

サウンド/サウンド/ブザー駆動コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendSound(SoundChannel channel);
    void AppendSound(SoundChannel channel, int repeat);
    void AppendSound(SoundChannel channel, int repeat, int driveTime, int delayTime);
    
  • 引数

    名称

    説明

    ライブラリバージョン

    channel

    サウンド/ブザーチャネル

    SoundChannel

    1.1.0+
    repeat

    繰り返し回数

    int

    1.1.0+
    driveTime

    駆動時間(1ミリ秒単位)

    int

    1.4.0+
    delayTime

    ディレイ時間(1ミリ秒単位)

    int

    1.4.0+
  • 戻り値

    なし

警告

ブザー以外を接続して本メソッドを使用しないでください。正常動作しない場合や、プリンターおよび外部機器本体が破損する恐れがあります。

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.46. AppendBarcodeData

バーコード印刷コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    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)
    
  • 引数

    名称

    説明

    otherData
    bytes
    length

    バーコードデータ

    IBuffer
    byte[]
    int

    symbology

    バーコードシンボル

    BarcodeSymbology

    width

    バーコード幅

    BarcodeWidth

    height

    バーコードの高さ(ドット数単位)

    int

    hri

    バー下文字列
    true ... 印刷あり
    false ... 印刷なし

    bool

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.47. AppendBarcodeDataWithAbsolutePosition

絶対位置指定バーコード印刷コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    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)
    
  • 引数

    名称

    説明

    position

    絶対位置(ドット数単位)

    int

    otherData
    bytes
    length

    バーコードデータ

    IBuffer
    byte[]
    int

    symbology

    バーコードシンボル

    BarcodeSymbology

    width

    バーコード幅

    BarcodeWidth

    height

    バーコードの高さ(ドット数単位)

    int

    hri

    バー下文字列
    true ... 印刷あり
    false ... 印刷なし

    bool

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.48. AppendBarcodeDataWithAlignment

位置揃えバーコード印刷コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    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)
    
  • 引数

    名称

    説明

    position

    位置揃え指定

    AlignmentPosition

    otherData
    bytes
    length

    バーコードデータ

    IBuffer
    byte[]
    int

    symbology

    バーコードシンボル

    BarcodeSymbology

    width

    バーコード幅

    BarcodeWidth

    height

    バーコードの高さ(ドット数単位)

    int

    hri

    バー下文字列
    true ... 印刷あり
    false ... 印刷なし

    bool

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.49. AppendPdf417Data

PDF417印刷コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    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)
    
  • 引数

    名称

    説明

    otherData
    bytes
    length

    PDF417データ

    IBuffer
    byte[]
    int

    line

    ライン数

    int

    column

    カラム数

    int

    level

    PDF417 ECC(セキュリティレベル)

    Pdf417Level

    module

    モジュールX方向サイズ

    int

    aspect

    モジュールアスペクト比

    int

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.50. AppendPdf417DataWithAbsolutePosition

絶対位置指定PDF417印刷コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    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)
    
  • 引数

    名称

    説明

    position

    絶対位置(ドット数単位)

    int

    otherData
    bytes
    length

    PDF417データ

    IBuffer
    byte[]
    int

    line

    ライン数

    int

    column

    カラム数

    int

    level

    PDF417 ECC(セキュリティレベル)

    Pdf417Level

    module

    モジュールX方向サイズ

    int

    aspect

    モジュールアスペクト比

    int

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.51. AppendPdf417DataWithAlignment

位置揃えPDF417印刷コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    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)
    
  • 引数

    名称

    説明

    position

    位置揃え指定

    AlignmentPosition

    otherData
    bytes
    length

    PDF417データ

    IBuffer
    byte[]
    int

    line

    ライン数

    int

    column

    カラム数

    int

    level

    PDF417 ECC(セキュリティレベル)

    Pdf417Level

    module

    モジュールX方向サイズ

    int

    aspect

    モジュールアスペクト比

    int

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.52. AppendQrCodeData

QRコード印刷コマンドを生成し、コマンドバッファに追加します。

  • 宣言

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

    名称

    説明

    otherData
    bytes
    length

    QRコードデータ

    IBuffer
    byte[]
    int

    model

    QRコードモデル

    QrCodeModel

    level

    QRコード誤り訂正レベル

    QrCodeLevel

    cell

    QRコードセルサイズ

    int

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.53. AppendQrCodeDataWithAbsolutePosition

絶対位置指定QRコード印刷コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    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)
    
  • 引数

    名称

    説明

    position

    絶対位置(ドット数単位)

    int

    otherData
    bytes
    length

    QRコードデータ

    IBuffer
    byte[]
    int

    model

    QRコードモデル

    QrCodeModel

    level

    QRコード誤り訂正レベル

    QrCodeLevel

    cell

    QRコードセルサイズ

    int

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.54. AppendQrCodeDataWithAlignment

位置揃えQRコード印刷コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    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)
    
  • 引数

    名称

    説明

    position

    位置揃え指定

    AlignmentPosition

    otherData
    bytes
    length

    QRコードデータ

    IBuffer
    byte[]
    int

    model

    QRコードモデル

    QrCodeModel

    level

    QRコード誤り訂正レベル

    QrCodeLevel

    cell

    QRコードセルサイズ

    int

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.cs / 各コマンド仕様書を参照ください。

4.2.55. AppendBitmapAsync

ビットマップ印刷コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    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)
    
  • 引数

    名称

    説明

    bitmap

    元となるビットマップオブジェクト

    Windows.Graphics.Imaging.BitmapDecoder

    diffusion

    誤差拡散
    true ... 誤差拡散を行う
    false ... 誤差拡散を行わない

    bool

    width

    変換後のビットマップ幅(ドット数単位)

    int

    bothScale

    widthプロパティによる変換率に合わせた高さ変換
    true ... 高さ変換を行う
    false ... 高さ変換を行わない

    bool

    rotation

    変換後の回転

    BitmapConverterRotation

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.56. AppendBitmapWithAbsolutePositionAsync

絶対位置指定ビットマップ印刷コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    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)
    
  • 引数

    名称

    説明

    position

    絶対位置(ドット数単位)

    int

    bitmap

    元となるビットマップオブジェクト

    Windows.Graphics.Imaging.BitmapDecoder

    diffusion

    誤差拡散
    true ... 誤差拡散を行う
    false ... 誤差拡散を行わない

    bool

    width

    変換後のビットマップ幅(ドット数単位)

    int

    bothScale

    widthプロパティによる変換率に合わせた高さ変換
    true ... 高さ変換を行う
    false ... 高さ変換を行わない

    bool

    rotation

    変換後の回転

    BitmapConverterRotation

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.57. AppendBitmapWithAlignmentAsync

位置揃えビットマップ印刷コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    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)
    
  • 引数

    名称

    説明

    position

    位置揃え指定

    AlignmentPosition

    bitmap

    元となるビットマップオブジェクト

    Windows.Graphics.Imaging.BitmapDecoder

    diffusion

    誤差拡散
    true ... 誤差拡散を行う
    false ... 誤差拡散を行わない

    bool

    width

    変換後のビットマップ幅(ドット数単位)

    int

    bothScale

    widthプロパティによる変換率に合わせた高さ変換
    true ... 高さ変換を行う
    false ... 高さ変換を行わない

    bool

    rotation

    変換後の回転

    BitmapConverterRotation

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.58. AppendBlackMark

added in version 1.2.0

ブラックマーク検出コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendBlackMark(BlackMarkType type);
    
  • 引数

    名称

    説明

    type

    ブラックマーク検出指定

    BlackMarkType

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.59. AppendLabel

added in version 1.11.0

ダイカットラベル紙等のギャップ検出指定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendLabelType(LabelType type);
    
  • 引数

    名称

    説明

    type

    ギャップ検出指定

    LabelType

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.60. BeginPageMode

added in version 1.2.0

ページモード開始コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void BeginPageMode(PageModePrintRegion printRegion, BitmapConverterRotation
    
  • 引数

    名称

    説明

    rect

    位置とサイズ(ドット数単位)

    PageModePrintRegion

    rotation

    印刷方向

    BitmapConverterRotation

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.61. EndPageMode

added in version 1.2.0

ページモード終了コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void EndPageMode();
    
  • 引数

    なし

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.62. AppendPageModeVerticalAbsolutePosition

added in version 1.2.0

ページモードの縦方向絶対位置指定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendPageModeVerticalAbsolutePosition(int position);
    
  • 引数

    名称

    説明

    position

    縦方向の絶対位置(ドット数単位)

    int

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.63. AppendPageModeRotation

added in version 1.2.0

ページモード印刷方向コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendPageModeRotation(BitmapConverterRotation rotation);
    
  • 引数

    名称

    説明

    rotation

    印刷方向

    BitmapConverterRotation

  • 戻り値

    なし

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.64. AppendPrintableArea

added in version 1.4.0

印字領域設定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendPrintableArea(PrintableAreaType type);
    
  • 引数

    名称

    説明

    type

    印字領域タイプ

    PrintableAreaType

  • 戻り値

    なし

単位:mm

指定するPrintableAreaTypeと設定される印字領域の対応は以下のとおりです。

モデル/エミュレーション

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 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 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] - - - - - - - - - - 64[1][3] - 72[1] 63

Type1

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

Type2

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

Type3

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]

2インチ紙を使用時、3インチ幅の印字領域設定を行わないでください

[2]

3インチ紙を使用時、4インチ幅の印字領域設定を行わないでください

[3]

メモリスイッチの印字桁数を”最大桁数”に設定することで、Standardの場合72mm、Type3の場合50.8mmに設定されます。(メモリスイッチ4のビット4を1に設定)

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.2.65. AppendCjkUnifiedIdeographFont

added in version 1.8.0

UTF-8におけるCJK統合漢字のフォント設定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendCjkUnifiedIdeographFont (params CjkUnifiedIdeographFont[] fonts)
    
  • 引数

    名称

    説明

    font

    CJK統合漢字のフォント
    2つ以上のフォントを指定した場合、先に指定したフォントから優先して印字されます。
    引数に何も指定しない場合、CJK統合漢字のフォント設定をメモリスイッチ設定に戻します。

    CjkUnifiedIdeographFont

  • 戻り値

    なし

  • 実装例

    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());
    }
    

    UTF8MultiLanguageReceiptsImple.csを参照ください。

4.2.66. AppendHoldPrint

added in version 1.10.0

プリンターファームウェアによる用紙保持制御の指定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendHoldPrint(HoldPrintType type);
    
  • 引数

    名称

    説明

    type

    用紙保持制御

    HoldPrintType

  • 戻り値

    なし

注釈

用紙保持制御の有効化

以下の設定により、用紙保持制御(用紙が抜き取られるまで BeginCheckedBlockAsync メソッドがブロックされる)が有効化されます。 実装例も参照ください。

  1. 本メソッドで生成したコマンドにより、プリンターファームウェアによる用紙保持制御を無効に設定

  2. AppendPaperPresentStatus メソッドで生成したコマンドにより、用紙保持ステータスを有効に設定

  • 実装例

    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

用紙保持ステータス指定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void AppendPaperPresentStatus(PaperPresentStatusType type);
    
  • 引数

    名称

    説明

    type

    用紙保持ステータス

    PaperPresentStatusType

  • 戻り値

    なし

  • 実装例

    AppendHoldPrint メソッドの実装例を参照ください。

4.2.68. GetCommands

コマンドバッファを取得します。

  • 宣言

    IBuffer GetCommands ()
    
  • 引数

    なし

  • 戻り値

    説明

    コマンドバッファ

    IBuffer

  • 実装例

    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();
    }
    

    ApiFunctions.csを参照ください。

4.3. PageModePrintRegion

ページモードにおける印字領域のクラスです。

  • 宣言

    public sealed class PageModePrintRegion
    
  • コンストラクタ

    名称

    説明

    PageModePrintRegion

    PageModePrintRegionオブジェクトを作成します。

  • プロパティ

    なし

  • メソッド

    なし

4.3.1. PageModePrintRegion

PageModePrintRegionオブジェクトを作成します。

  • 構文

    public PageModePrintRegion(int x, int y, int width, int height)
    
  • 引数

    名称

    説明

    x

    ページモードにおける印字領域の横方向始点

    int

    y

    ページモードにおける印字領域の縦方向始点

    int

    width

    ページモードにおける印字領域の横方向長さ

    int

    weight

    ページモードにおける印字領域の縦方向長さ

    int

  • 戻り値

    説明

    PageModePrintRegionオブジェクト

    PageModePrintRegion

  • 実装例

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

    ApiFunctions.csを参照ください