import { StarXpandCommand } from "star-io10-web"; export class LabelSample16_For203dpiAnd300dpi_ShelfLabelForInventory { static async createPrintCommands(): Promise { let builder = new StarXpandCommand.StarXpandCommandBuilder(); builder.addDocument( new StarXpandCommand.DocumentBuilder().addPrinter( new StarXpandCommand.PrinterBuilder() // モデルにより対応する文字エンコーディング指定APIが異なります。 // 下記ページのSupported Modelを参照し、ご利用のモデルが対応するAPIを使用してください。 // https://www.star-m.jp/products/s_print/sdk/star-io10-web/manual/ja/api-reference/star-xpand-command/printer-builder/style-cjk-character-priority.html .styleCjkCharacterPriority([ StarXpandCommand.Printer.CjkCharacterType.Japanese, ]) // https://www.star-m.jp/products/s_print/sdk/star-io10-web/manual/ja/api-reference/star-xpand-command/printer-builder/style-second-priority-character-encoding.html //.styleSecondPriorityCharacterEncoding(CharacterEncodingType.Japanese) .addPageMode( new StarXpandCommand.Printer.PageModeAreaParameter(48.0, 36.0), new StarXpandCommand.PageModeBuilder() .styleVerticalPositionTo(6.0) .add( new StarXpandCommand.PageModeBuilder() .styleMagnification( new StarXpandCommand.MagnificationParameter(2, 2), ) .actionPrintText("1234 5678 素材S"), ) .styleHorizontalPositionTo(0.0) .styleVerticalPositionTo(15.0) .actionPrintQRCode( new StarXpandCommand.Printer.QRCodeParameter("12345678素材S") .setCellSize(4) .setLevel(StarXpandCommand.Printer.QRCodeLevel.L) .setModel(StarXpandCommand.Printer.QRCodeModel.Model2), ) .addPageMode( new StarXpandCommand.Printer.PageModeAreaParameter(35.0, 24.0) .setX(13.0) .setY(12.0), new StarXpandCommand.PageModeBuilder().actionPrintText( "スター精密\n" + "S1\n" + "使用材料名:アクリル樹脂\n" + "金型取数:1\n" + "整形場所:Star Micronics\n", ), ), ) .actionCut(StarXpandCommand.Printer.CutType.Partial), ), ); return await builder.getCommands(); } }