Exemplo n.º 1
0
        public override void Append3inchTextReceiptData(ICommandBuilder builder, bool utf8)
        {
            string encoding;

            if (utf8)
            {
                encoding = "UTF-8";

                builder.AppendCodePage(CodePageType.UTF8);
            }
            else
            {
                encoding = "Windows-1252";

                builder.AppendCodePage(CodePageType.CP1252);
            }

            builder.AppendInternational(InternationalType.Spain);

            builder.AppendCharacterSpace(0);

            builder.AppendAlignment(AlignmentPosition.Center);

            builder.AppendMultiple(Encoding.GetEncoding(encoding).GetBytes("BAR RESTAURANT EL POZO\n"), 2, 2);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "C/.ROCAFORT 187 08029 BARCELONA\n" +
                               "NIF :X-3856907Z  TEL :934199465\n"));

            builder.AppendAlignment(AlignmentPosition.Left);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "------------------------------------------------\n" +
                               "MESA: 100 P: - FECHA: YYYY-MM-DD\n" +
                               "CAN P/U DESCRIPCION  SUMA\n" +
                               "------------------------------------------------\n" +
                               " 4     3,00      JARRA  CERVEZA            12,00\n" +
                               " 1     1,60      COPA DE CERVEZA            1,60\n" +
                               "------------------------------------------------\n" +
                               "                           SUB TOTAL :     13,60\n"));

            builder.AppendAlignment(AlignmentPosition.Right);

            builder.AppendMultipleHeight(Encoding.GetEncoding(encoding).GetBytes("TOTAL:     13,60 EUROS\n"), 2);

            builder.AppendAlignment(AlignmentPosition.Left);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "NO: 000018851  IVA INCLUIDO\n" +
                               "------------------------------------------------\n"));

            builder.AppendAlignment(AlignmentPosition.Center);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "**** GRACIAS POR SU VISITA! ****\n" +
                               "\n"));

            builder.AppendBarcode(Encoding.GetEncoding("ASCII").GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
        }
        public void AppendEscPos3inchTextReceiptData(ICommandBuilder commandBuilder, bool utf8)
        {
            Encoding encoding;

            if (utf8)
            {
                encoding = Encoding.UTF8;

                commandBuilder.AppendCodePage(CodePageType.UTF8);
            }
            else
            {
                encoding = Encoding.GetEncoding("Windows-1252");

                commandBuilder.AppendCodePage(CodePageType.CP1252);
            }

            commandBuilder.AppendInternational(InternationalType.Germany);

            commandBuilder.AppendCharacterSpace(0);

            commandBuilder.AppendAlignment(AlignmentPosition.Center);

            commandBuilder.AppendMultiple(encoding.GetBytes("STAR\n" +
                                                            "Supermarkt\n"), 2, 2);

            commandBuilder.Append(encoding.GetBytes("\n" +
                                                    "Das Internet von seiner\n" +
                                                    "genussvollsten Seite\n" +
                                                    "\n"));

            commandBuilder.AppendMultipleHeight(encoding.GetBytes("www.Star-EMEM.com\n"), 2);

            commandBuilder.Append(encoding.GetBytes("Gebührenfrei Rufnummer:\n"));

            commandBuilder.AppendEmphasis(encoding.GetBytes("08006646701\n"));

            commandBuilder.AppendAlignment(AlignmentPosition.Left);

            commandBuilder.Append(encoding.GetBytes("------------------------------------------\n"));

            commandBuilder.AppendEmphasis(encoding.GetBytes("                                       EUR\n"));

            commandBuilder.Append(encoding.GetBytes("Schmand 24%                           0.42\n" +
                                                    "Kefir                                 0.79\n" +
                                                    "Haarspray                             1.79\n" +
                                                    "Gurken ST                             0.59\n" +
                                                    "Mandelknacker                         1.59\n" +
                                                    "Mandelknacker                         1.59\n" +
                                                    "Nussecken                             1.69\n" +
                                                    "Nussecken                             1.69\n" +
                                                    "Clemen.1kg NZ                         1.49\n" +
                                                    "2X\n" +
                                                    "Zitronen ST                           1.18\n" +
                                                    "4X\n" +
                                                    "Grapefruit                            3.16\n" +
                                                    "Party Garnelen                        9.79\n" +
                                                    "Apfelsaft                             1.39\n" +
                                                    "Lauchzw./Schl.B                       0.49\n" +
                                                    "Butter                                1.19\n" +
                                                    "Profi-Haartrockner                   27.99\n" +
                                                    "Mozarella 45%                         0.59\n" +
                                                    "Mozarella 45%                         0.59\n" +
                                                    "Bruschetta Brot                       0.59\n" +
                                                    "Weizenmehl                            0.39\n" +
                                                    "Jodsalz                               0.19\n" +
                                                    "Eier M braun Bod                      1.79\n" +
                                                    "Schlagsahne                           1.69\n" +
                                                    "Schlagsahne                           1.69\n" +
                                                    "\n" +
                                                    "Rueckgeld                        EUR  0.00\n" +
                                                    "\n" +
                                                    "19.00% MwSt.                         13.14\n" +
                                                    "NETTO-UMSATZ                         82.33\n" +
                                                    "------------------------------------------\n" +
                                                    "KontoNr:  0551716000 / 0 / 0512\n" +
                                                    "BLZ:      58862159\n" +
                                                    "Trace-Nr: 027929\n" +
                                                    "Beleg:    7238\n" +
                                                    "------------------------------------------\n" +
                                                    "Kas: 003/006    Bon  0377 PC01 P\n" +
                                                    "Dat: 30.03.2015 Zeit 18:06:01 43\n" +
                                                    "\n"));

            commandBuilder.AppendAlignment(AlignmentPosition.Center);

            commandBuilder.Append(encoding.GetBytes("USt–ID:    DE125580123\n" +
                                                    "\n"));

            commandBuilder.AppendEmphasis(encoding.GetBytes("Vielen dank\n" +
                                                            "für Ihren Einkauf!\n" +
                                                            "\n"));

//          commandBuilder.AppendBarcode(encoding      .GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
//          commandBuilder.AppendBarcode(Encoding.ASCII.GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
            commandBuilder.AppendBarcode(Encoding.UTF8.GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
        }
        public override void AppendEscPos3inchTextReceiptData(ICommandBuilder builder, bool utf8)
        {
            string encoding;

            if (utf8)
            {
                encoding = "UTF-8";

                builder.AppendCodePage(CodePageType.UTF8);
            }
            else
            {
                encoding = "Big5";
            }

            builder.AppendCharacterSpace(0);

            builder.AppendAlignment(AlignmentPosition.Center);

            builder.AppendEmphasis(true);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes("\n"));

            builder.AppendMultipleHeight(Encoding.GetEncoding(encoding).GetBytes("Star Micronics\n"), 3);

            builder.AppendEmphasis(false);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes("------------------------------------------\n"));

            builder.AppendMultiple(Encoding.GetEncoding(encoding).GetBytes(
                                       "電子發票證明聯\n" +
                                       "103年01-02月\n" +
                                       "EV-99999999\n"), 2, 2);

            builder.AppendAlignment(AlignmentPosition.Left);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "2014/01/15 13:00\n" +
                               "隨機碼 : 9999    總計 : 999\n" +
                               "賣方 : 99999999\n" +
                               "\n"));

            builder.AppendAlignment(AlignmentPosition.Center);

            builder.AppendQrCode(Encoding.GetEncoding("ASCII").GetBytes("http://www.star-m.jp/eng/index.html"), QrCodeModel.No2, QrCodeLevel.Q, 5);

            builder.AppendAlignment(AlignmentPosition.Left);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "\n" +
                               "商品退換請持本聯及銷貨明細表。\n" +
                               "9999999-9999999 999999-999999 9999\n" +
                               "\n"));

            builder.AppendAlignment(Encoding.GetEncoding(encoding).GetBytes("銷貨明細表  (銷售)\n"), AlignmentPosition.Center);

            builder.AppendAlignment(Encoding.GetEncoding(encoding).GetBytes("2014-01-15 13:00:02\n"), AlignmentPosition.Right);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "\n" +
                               "烏龍袋茶2g20入                55 x2 110TX\n" +
                               "茉莉烏龍茶2g20入              55 x2 110TX\n" +
                               "天仁觀音茶2g*20               55 x2 110TX\n"));

            builder.AppendEmphasis(Encoding.GetEncoding(encoding).GetBytes(
                                       "      小  計 :                330\n" +
                                       "      總   計 :                330\n"));

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "------------------------------------------\n" +
                               "現 金                          400\n" +
                               "      找  零 :                 70\n"));

            builder.AppendEmphasis(Encoding.GetEncoding(encoding).GetBytes(" 101 發票金額 :                330\n"));

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "2014-01-15 13:00\n" +
                               "\n"));

            builder.AppendAlignment(AlignmentPosition.Center);

            builder.AppendBarcode(Encoding.GetEncoding("ASCII").GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);

            builder.AppendAlignment(AlignmentPosition.Left);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "\n" +
                               "商品退換、贈品及停車兌換請持本聯。\n" +
                               "9999999-9999999 999999-999999 9999\n"));
        }
Exemplo n.º 4
0
        public void Append3inchTextReceiptData(ICommandBuilder commandBuilder, bool utf8)
        {
            Encoding encoding;

            if (utf8)
            {
                encoding = Encoding.UTF8;

                commandBuilder.AppendCodePage(CodePageType.UTF8);
            }
            else
            {
                encoding = Encoding.GetEncoding("Windows-1252");

                commandBuilder.AppendCodePage(CodePageType.CP1252);
            }

            commandBuilder.AppendInternational(InternationalType.France);

            commandBuilder.AppendCharacterSpace(0);

            commandBuilder.AppendAlignment(AlignmentPosition.Center);

//          commandBuilder.Append(encoding.GetBytes("[If loaded.. Logo1 goes here]\n"));
//
//          commandBuilder.AppendLogo(LogoSize.Normal, 1);

            commandBuilder.AppendMultipleHeight(encoding.GetBytes("Star Micronics Communications\n"), 2);

            commandBuilder.Append(encoding.GetBytes("AVENUE LA MOTTE PICQUET\n" +
                                                    "\n"));

            commandBuilder.AppendAlignment(AlignmentPosition.Left);

            commandBuilder.Append(encoding.GetBytes("------------------------------------------------\n" +
                                                    "Date: MM/DD/YYYY    Heure: HH:MM\n" +
                                                    "Boutique: OLUA23    Caisse: 0001\n" +
                                                    "Conseiller: 002970  Ticket: 3881\n" +
                                                    "------------------------------------------------\n" +
                                                    "\n" +
                                                    "Vous avez été servi par : Souad\n" +
                                                    "\n" +
                                                    "CAC IPHONE\n" +
                                                    "3700615033581   1    X     19.99€         19.99€\n" +
                                                    "\n" +
                                                    "dont contribution environnementale :\n" +
                                                    "CAC IPHONE                                 0.01€\n" +
                                                    "------------------------------------------------\n" +
                                                    "1 Piéce(s) Total :                        19.99€\n" +
                                                    "Mastercard Visa  :                        19.99€\n" +
                                                    "\n" +
                                                    "Taux TVA    Montant H.T.   T.V.A\n" +
                                                    "  20%          16.66€      3.33€\n" +
                                                    "\n"));

            commandBuilder.AppendAlignment(AlignmentPosition.Center);

            commandBuilder.Append(encoding.GetBytes("Merci de votre visite et. à bientôt.\n" +
                                                    "Conservez votre ticket il\n" +
                                                    "vous sera demandé pour tout échange.\n"));

//          commandBuilder.AppendBarcode(encoding      .GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
//          commandBuilder.AppendBarcode(Encoding.ASCII.GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
            commandBuilder.AppendBarcode(Encoding.UTF8.GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
        }
Exemplo n.º 5
0
        public override void AppendEscPos3inchTextReceiptData(ICommandBuilder builder, bool utf8)
        {
            string encoding;

            if (utf8)
            {
                encoding = "UTF-8";

                builder.AppendCodePage(CodePageType.UTF8);
            }
            else
            {
                encoding = "Windows-1252";

                builder.AppendCodePage(CodePageType.CP1252);
            }

            builder.AppendCharacterSpace(0);

            builder.AppendAlignment(AlignmentPosition.Center);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes("\n"));

            builder.AppendMultipleHeight(Encoding.GetEncoding(encoding).GetBytes("COMERCIAL DE ALIMENTOS STAR LTDA.\n"), 2);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "Avenida Moyses Roysen, S/N  Vila Guilherme\n" +
                               "Cep: 02049-010 – Sao Paulo – SP\n" +
                               "CNPJ: 62.545.579/0013-69\n" +
                               "IE:110.819.138.118  IM: 9.041.041-5\n"));

            builder.AppendAlignment(AlignmentPosition.Left);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "------------------------------------------\n" +
                               "MM/DD/YYYY HH:MM:SS  CCF:133939 COO:227808\n" +
                               "------------------------------------------\n" +
                               "CUPOM FISCAL\n" +
                               "------------------------------------------\n" +
                               "001   2505    CAFÉ DO PONTO TRAD A\n" +
                               "                            1un F1  8,15)\n" +
                               "002   2505    CAFÉ DO PONTO TRAD A\n" +
                               "                            1un F1  8,15)\n" +
                               "003   2505    CAFÉ DO PONTO TRAD A\n" +
                               "                            1un F1  8,15)\n" +
                               "004   6129    AGU MIN NESTLE 510ML\n" +
                               "                            1un F1  1,39)\n" +
                               "005   6129    AGU MIN NESTLE 510ML\n" +
                               "                            1un F1  1,39)\n" +
                               "------------------------------------------\n"));

            builder.AppendMultipleWidth(Encoding.GetEncoding(encoding).GetBytes("TOTAL  R$      27,23\n"), 2);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "DINHEIROv                          29,00\n" +
                               "TROCO R$                            1,77\n" +
                               "Valor dos Tributos R$2,15 (7,90%)\n"));

            builder.AppendAlignment(AlignmentPosition.Center);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "ITEM(S) CINORADIS 5\n" +
                               "OP.:15326  PDV:9  BR,BF:93466\n" +
                               "OBRIGADO PERA PREFERENCIA.\n"));

            builder.AppendMultipleWidth(Encoding.GetEncoding(encoding).GetBytes(
                                            "VOLTE SEMPRE!\n" +
                                            "\n"), 2);

            builder.AppendAlignment(AlignmentPosition.Left);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "SAC 0800 724 2822\n" +
                               "------------------------------------------\n" +
                               "MD5:fe028828a532a7dbaf4271155aa4e2db\n" +
                               "Calypso_CA CA.20.c13 – Unisys Brasil\n" +
                               "------------------------------------------\n" +
                               "DARUMA AUTOMAÇÃO   MACH 2\n" +
                               "ECF-IF VERSÃO:01,00,00 ECF:093\n" +
                               "Lj:0204 OPR:ANGELA JORGE\n" +
                               "\n"));

            builder.AppendAlignment(AlignmentPosition.Center);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "DDDDDDDDDAEHFGBFCC\n" +
                               "MM/DD/YYYY HH:MM:SS\n" +
                               "FAB:DR0911BR000000275026\n" +
                               "\n"));

            builder.AppendBarcode(Encoding.GetEncoding("ASCII").GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
        }
Exemplo n.º 6
0
        public override void Append3inchTextReceiptData(ICommandBuilder builder, bool utf8)
        {
            string encoding;

            if (utf8)
            {
                encoding = "UTF-8";

                builder.AppendCodePage(CodePageType.UTF8);
            }
            else
            {
                encoding = "Shift_JIS";

                builder.AppendCodePage(CodePageType.CP932);
            }

            builder.AppendInternational(InternationalType.Japan);

            builder.AppendCharacterSpace(0);

            builder.AppendAlignment(AlignmentPosition.Center);

            builder.AppendEmphasis(true);

            builder.AppendMultipleHeight(Encoding.GetEncoding(encoding).GetBytes("スター電機\n"), 3);

            builder.AppendMultipleHeight(Encoding.GetEncoding(encoding).GetBytes("修理報告書 兼領収書\n"), 2);

            builder.AppendEmphasis(false);

            builder.AppendAlignment(AlignmentPosition.Left);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "------------------------------------------------\n" +
                               "発行日時:YYYY年MM月DD日HH時MM分\n" +
                               "TEL:054-347-XXXX\n" +
                               "\n" +
                               "           イケニシ  シズコ   サマ\n" +
                               " お名前:池西 静子 様\n" +
                               " 御住所:静岡市清水区七ツ新屋\n" +
                               "     536番地\n" +
                               " 伝票番号:No.12345-67890\n" +
                               "\n" +
                               " この度は修理をご用命頂き有難うございます。\n" +
                               " 今後も故障など発生した場合はお気軽にご連絡ください。\n" +
                               "\n" +
                               "品名/型名           数量      金額    備考\n" +
                               "------------------------------------------------\n" +
                               "制御基板              1      10,000     配達\n" +
                               "操作スイッチ            1       3,800     配達\n" +
                               "パネル               1       2,000     配達\n" +
                               "技術料               1      15,000\n" +
                               "出張費用              1       5,000\n" +
                               "------------------------------------------------\n" +
                               "\n" +
                               "                            小計       \\ 35,800\n" +
                               "                            内税       \\  1,790\n" +
                               "                            合計       \\ 37,590\n" +
                               "\n" +
                               " お問合わせ番号  12345-67890\n" +
                               "\n"));

            builder.AppendAlignment(AlignmentPosition.Center);

            builder.AppendBarcode(Encoding.GetEncoding("ASCII").GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
        }
Exemplo n.º 7
0
        public override void Append3inchTextReceiptData(ICommandBuilder builder, bool utf8)
        {
            string encoding;
            if (utf8)
            {
                encoding = "UTF-8";

                builder.AppendCodePage(CodePageType.UTF8);
            }
            else
            {
                encoding = "ASCII";

                builder.AppendCodePage(CodePageType.CP998);
            }

            builder.AppendInternational(InternationalType.USA);

            builder.AppendCharacterSpace(0);

            builder.AppendAlignment(AlignmentPosition.Center);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                            "Star Clothing Boutique\n" +
                            "123 Star Road\n" +
                            "City, State 12345\n" +
                            "\n"));

            builder.AppendAlignment(AlignmentPosition.Left);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                            "Date:MM/DD/YYYY                    Time:HH:MM PM\n" +
                            "------------------------------------------------\n" +
                            "\n"));

            builder.AppendEmphasis(Encoding.GetEncoding(encoding).GetBytes("SALE\n"));

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                            "SKU               Description              Total\n" +
                            "300678566         PLAIN T-SHIRT            10.99\n" +
                            "300692003         BLACK DENIM              29.99\n" +
                            "300651148         BLUE DENIM               29.99\n" +
                            "300642980         STRIPED DRESS            49.99\n" +
                            "300638471         BLACK BOOTS              35.99\n" +
                            "\n" +
                            "Subtotal                                  156.95\n" +
                            "Tax                                         0.00\n" +
                            "------------------------------------------------\n"));

            builder.Append(Encoding.GetEncoding(encoding).GetBytes("Total                       "));

            builder.AppendMultiple(Encoding.GetEncoding(encoding).GetBytes("   $156.95\n"), 2, 2);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                            "------------------------------------------------\n" +
                            "\n" +
                            "Charge\n" +
                            "156.95\n" +
                            "Visa XXXX-XXXX-XXXX-0123\n" +
                            "\n"));

            builder.AppendInvert(Encoding.GetEncoding(encoding).GetBytes("Refunds and Exchanges\n"));

            builder.Append(Encoding.GetEncoding(encoding).GetBytes("Within "));

            builder.AppendUnderLine(Encoding.GetEncoding(encoding).GetBytes("30 days"));

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(" with receipt\n"));

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                            "And tags attached\n" +
                            "\n"));

            builder.AppendAlignment(AlignmentPosition.Center);

            builder.AppendBarcode(Encoding.GetEncoding("ASCII").GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
        }
Exemplo n.º 8
0
        public static byte[] CreateBarcodeData(Emulation emulation)
        {
            byte[] dataUpcE    = Encoding.UTF8.GetBytes("01234500006");
            byte[] dataUpcA    = Encoding.UTF8.GetBytes("01234567890");
            byte[] dataJan8    = Encoding.UTF8.GetBytes("0123456");
            byte[] dataJan13   = Encoding.UTF8.GetBytes("012345678901");
            byte[] dataCode39  = Encoding.UTF8.GetBytes("0123456789");
            byte[] dataItf     = Encoding.UTF8.GetBytes("0123456789");
            byte[] dataCode128 = Encoding.UTF8.GetBytes("{B0123456789");
            byte[] dataCode93  = Encoding.UTF8.GetBytes("0123456789");
            byte[] dataNw7     = Encoding.UTF8.GetBytes("A0123456789B");

            ICommandBuilder builder = StarIoExt.CreateCommandBuilder(emulation);

            builder.BeginDocument();

            builder.Append(Encoding.UTF8.GetBytes("*UPCE*\n"));
            builder.AppendBarcode(dataUpcE, BarcodeSymbology.UPCE, BarcodeWidth.Mode1, 40, true);
            builder.AppendUnitFeed(32);
            builder.Append(Encoding.UTF8.GetBytes("\n*UPCA*\n"));
            builder.AppendBarcode(dataUpcA, BarcodeSymbology.UPCA, BarcodeWidth.Mode1, 40, true);
            builder.AppendUnitFeed(32);
            builder.Append(Encoding.UTF8.GetBytes("\n*JAN8*\n"));
            builder.AppendBarcode(dataJan8, BarcodeSymbology.JAN8, BarcodeWidth.Mode1, 40, true);
            builder.AppendUnitFeed(32);
            builder.Append(Encoding.UTF8.GetBytes("\n*JAN13*\n"));
            builder.AppendBarcode(dataJan13, BarcodeSymbology.JAN13, BarcodeWidth.Mode1, 40, true);
            builder.AppendUnitFeed(32);
            builder.Append(Encoding.UTF8.GetBytes("\n*Code39*\n"));
            builder.AppendBarcode(dataCode39, BarcodeSymbology.Code39, BarcodeWidth.Mode1, 40, true);
            builder.AppendUnitFeed(32);
            builder.Append(Encoding.UTF8.GetBytes("\n*ITF*\n"));
            builder.AppendBarcode(dataItf, BarcodeSymbology.ITF, BarcodeWidth.Mode1, 40, true);
            builder.AppendUnitFeed(32);
            builder.Append(Encoding.UTF8.GetBytes("\n*Code128*\n"));
            builder.AppendBarcode(dataCode128, BarcodeSymbology.Code128, BarcodeWidth.Mode1, 40, true);
            builder.AppendUnitFeed(32);
            builder.Append(Encoding.UTF8.GetBytes("\n*Code93*\n"));
            builder.AppendBarcode(dataCode93, BarcodeSymbology.Code93, BarcodeWidth.Mode1, 40, true);
            builder.AppendUnitFeed(32);
            builder.Append(Encoding.UTF8.GetBytes("\n*NW7*\n"));
            builder.AppendBarcode(dataNw7, BarcodeSymbology.NW7, BarcodeWidth.Mode1, 40, true);
            builder.AppendUnitFeed(32);

            builder.Append(Encoding.UTF8.GetBytes("*HRI:NO*\n"));
            builder.AppendBarcode(dataUpcE, BarcodeSymbology.UPCE, BarcodeWidth.Mode1, 40, false);
            builder.AppendUnitFeed(32);
            builder.Append(Encoding.UTF8.GetBytes("*Mode:1*\n"));
            builder.AppendBarcode(dataUpcE, BarcodeSymbology.UPCE, BarcodeWidth.Mode1, 40, true);
            builder.AppendUnitFeed(32);
            builder.Append(Encoding.UTF8.GetBytes("*Mode:2*\n"));
            builder.AppendBarcode(dataUpcE, BarcodeSymbology.UPCE, BarcodeWidth.Mode2, 40, true);
            builder.AppendUnitFeed(32);
            builder.Append(Encoding.UTF8.GetBytes("*Mode:3*\n"));
            builder.AppendBarcode(dataUpcE, BarcodeSymbology.UPCE, BarcodeWidth.Mode3, 40, true);
            builder.AppendUnitFeed(32);

            builder.Append(Encoding.UTF8.GetBytes("\n*AbsolutePosition:40*\n"));
            builder.AppendBarcodeWithAbsolutePosition(dataUpcE, BarcodeSymbology.UPCE, BarcodeWidth.Mode1, 40, true, 40);
            builder.AppendUnitFeed(32);

            builder.Append(Encoding.UTF8.GetBytes("\n*Alignment:Center*\n"));
            builder.AppendBarcodeWithAlignment(dataUpcE, BarcodeSymbology.UPCE, BarcodeWidth.Mode1, 40, true, AlignmentPosition.Center);
            builder.AppendUnitFeed(32);
            builder.Append(Encoding.UTF8.GetBytes("\n*Alignment:Right*\n"));
            builder.AppendBarcodeWithAlignment(dataUpcE, BarcodeSymbology.UPCE, BarcodeWidth.Mode1, 40, true, AlignmentPosition.Right);
            builder.AppendUnitFeed(32);

            builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);

            builder.EndDocument();

            return(builder.Commands);
        }
Exemplo n.º 9
0
        public override void Append3inchTextReceiptData(ICommandBuilder builder, bool utf8)
        {
            string encoding;

            if (utf8)
            {
                encoding = "UTF-8";

                builder.AppendCodePage(CodePageType.UTF8);
            }
            else
            {
                encoding = "GB2312";
            }

            builder.AppendCharacterSpace(0);

            builder.AppendAlignment(AlignmentPosition.Center);

            builder.AppendEmphasis(true);

            builder.AppendMultipleHeight(Encoding.GetEncoding(encoding).GetBytes("STAR便利店\n"), 3);

            builder.AppendMultipleHeight(Encoding.GetEncoding(encoding).GetBytes("欢迎光临\n"), 2);

            builder.AppendEmphasis(false);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "Unit 1906-08, 19/F, Enterprise Square 2,\n" +
                               " 3 Sheung Yuet Road, Kowloon Bay, KLN\n" +
                               "\n" +
                               "Tel : (852) 2795 2335\n" +
                               "\n"));

            builder.AppendAlignment(AlignmentPosition.Left);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes(
                               "货品名称                数量       价格\n" +
                               "------------------------------------------------\n" +
                               "\n" +
                               "罐装可乐\n" +
                               "* Coke                      1        7.00\n" +
                               "纸包柠檬茶\n" +
                               "* Lemon Tea                 2       10.00\n" +
                               "热狗\n" +
                               "* Hot Dog                   1       10.00\n" +
                               "薯片(50克装)\n" +
                               "* Potato Chips(50g)         1       11.00\n" +
                               "------------------------------------------------\n" +
                               "\n" +
                               "                         总数 :     38.00\n" +
                               "                         现金 :     38.00\n" +
                               "                         找赎 :      0.00\n" +
                               "\n" +
                               "卡号码 Card No.       : 88888888\n" +
                               "卡余额 Remaining Val. : 88.00\n" +
                               "机号   Device No.     : 1234F1\n" +
                               "\n" +
                               "\n" +
                               "DD/MM/YYYY  HH:MM:SS  交易编号 : 88888\n" +
                               "\n"));

            builder.AppendAlignment(AlignmentPosition.Center);

            builder.Append(Encoding.GetEncoding(encoding).GetBytes("收银机 : 001  收银员 : 180\n"));

            builder.AppendBarcode(Encoding.GetEncoding("ASCII").GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
        }
Exemplo n.º 10
0
        public void Append2inchTextReceiptData(ICommandBuilder commandBuilder, bool utf8)
        {
            Encoding encoding;

            if (utf8)
            {
                encoding = Encoding.UTF8;

                commandBuilder.AppendCodePage(CodePageType.UTF8);
            }
            else
            {
                encoding = Encoding.GetEncoding("gb2312");
//              encoding = Encoding.GetEncoding("GB18030");

//              commandBuilder.AppendCodePage(CodePageType.CP1252);
            }

//          commandBuilder.AppendInternational(InternationalType.UK);

            commandBuilder.AppendCharacterSpace(0);

            commandBuilder.AppendAlignment(AlignmentPosition.Center);

            commandBuilder.AppendEmphasis(true);

            commandBuilder.AppendMultipleHeight(encoding.GetBytes("STAR便利店\n"), 3);

            commandBuilder.AppendMultipleHeight(encoding.GetBytes("欢迎光临\n"), 2);

            commandBuilder.AppendEmphasis(false);

            commandBuilder.Append(encoding.GetBytes("Unit 1906-08, 19/F,\n" +
                                                    "Enterprise Square 2,\n" +
                                                    "3 Sheung Yuet Road,\n" +
                                                    "Kowloon Bay, KLN\n" +
                                                    "\n" +
                                                    "Tel : (852) 2795 2335\n" +
                                                    "\n"));

            commandBuilder.AppendAlignment(AlignmentPosition.Left);

            commandBuilder.Append(encoding.GetBytes("货品名称           数量     价格\n" +
                                                    "--------------------------------\n" +
                                                    "\n" +
                                                    "罐装可乐\n" +
                                                    "* Coke                 1    7.00\n" +
                                                    "纸包柠檬茶\n" +
                                                    "* Lemon Tea            2   10.00\n" +
                                                    "热狗\n" +
                                                    "* Hot Dog              1   10.00\n" +
                                                    "薯片(50克装)\n" +
                                                    "* Potato Chips(50g)    1   11.00\n" +
                                                    "--------------------------------\n" +
                                                    "\n" +
                                                    "              总数 :       38.00\n" +
                                                    "              现金 :       38.00\n" +
                                                    "              找赎 :        0.00\n" +
                                                    "\n" +
                                                    "卡号码 Card No.       : 88888888\n" +
                                                    "卡余额 Remaining Val.    : 88.00\n" +
                                                    "机号   Device No.       : 1234F1\n" +
                                                    "\n" +
                                                    "\n" +
                                                    "DD/MM/YYYY  HH:MM:SS\n" +
                                                    "交易编号 : 88888\n" +
                                                    "\n"));

            commandBuilder.AppendAlignment(AlignmentPosition.Center);

            commandBuilder.Append(encoding.GetBytes("收银机 : 001  收银员 : 180\n" +
                                                    "\n"));

//          commandBuilder.AppendBarcode(encoding      .GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
//          commandBuilder.AppendBarcode(Encoding.ASCII.GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
            commandBuilder.AppendBarcode(Encoding.UTF8.GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
        }
        public void AppendEscPos3inchTextReceiptData(ICommandBuilder commandBuilder, bool utf8)
        {
            Encoding encoding;

            if (utf8)
            {
                encoding = Encoding.UTF8;

                commandBuilder.AppendCodePage(CodePageType.UTF8);
            }
            else
            {
                encoding = Encoding.GetEncoding("Windows-1251");

                commandBuilder.AppendCodePage(CodePageType.CP1251);
            }

//          commandBuilder.AppendInternational(InternationalType.UK);

            commandBuilder.AppendCharacterSpace(0);

            commandBuilder.AppendAlignment(AlignmentPosition.Center);

            commandBuilder.AppendMultiple(encoding.GetBytes("Р Е Л А К С\n"), 2, 2);

            commandBuilder.Append(encoding.GetBytes("ООО “РЕЛАКС”\n" +
                                                    "СПб., Малая Балканская, д. 38, лит. А\n" +
                                                    "тел. 307-07-12\n"));

            commandBuilder.AppendAlignment(AlignmentPosition.Left);

            commandBuilder.Append(encoding.GetBytes("РЕГ №322736 ИНН : 123321\n" +
                                                    "01  Белякова И.А.  КАССА: 0020 ОТД.01\n"));

            commandBuilder.AppendAlignment(encoding.GetBytes("ЧЕК НА ПРОДАЖУ  No 84373\n"), AlignmentPosition.Center);

            commandBuilder.Append(encoding.GetBytes("------------------------------------------\n" +
                                                    "1.     Яблоки Айдаред, кг           144.50\n" +
                                                    "2.     Соус соевый Sen So            36.40\n" +
                                                    "3.     Соус томатный Клас            19.90\n" +
                                                    "4.     Ребра свиные в.к м            78.20\n" +
                                                    "5.     Масло подсол раф д           114.00\n" +
                                                    "6.     Блокнот 10х14см сп           164.00\n" +
                                                    "7.     Морс Северная Ягод            99.90\n" +
                                                    "8.     Активия Биойогурт             43.40\n" +
                                                    "9.     Бублики Украинские            26.90\n" +
                                                    "10.    Активия Биойогурт             43.40\n" +
                                                    "11.    Сахар-песок 1кг               58.40\n" +
                                                    "12.    Хлопья овсяные Ясн            38.40\n" +
                                                    "13.    Кинза 50г                     39.90\n" +
                                                    "14.    Пемза “Сердечко” .Т           37.90\n" +
                                                    "15.    Приправа Santa Mar            47.90\n" +
                                                    "16.    Томаты слива Выбор           162.00\n" +
                                                    "17.    Бонд Стрит Ред Сел            56.90\n" +
                                                    "------------------------------------------\n" +
                                                    "------------------------------------------\n" +
                                                    "ДИСКОНТНАЯ КАРТА  No: 2440012489765\n" +
                                                    "------------------------------------------\n"));

            commandBuilder.AppendAlignment(AlignmentPosition.Right);

            commandBuilder.Append(encoding.GetBytes("ИТОГО  К  ОПЛАТЕ     = 1212.00\n" +
                                                    "НАЛИЧНЫЕ             = 1212.00\n" +
                                                    "ВАША СКИДКА : 0.41\n" +
                                                    "\n"));

            commandBuilder.AppendAlignment(encoding.GetBytes("ЦЕНЫ УКАЗАНЫ С УЧЕТОМ СКИДКИ\n" +
                                                             "\n"), AlignmentPosition.Center);

            commandBuilder.Append(encoding.GetBytes("08-02-2015 09:49  0254.0130604\n" +
                                                    "00083213 #060127\n"));

            commandBuilder.AppendAlignment(AlignmentPosition.Center);

            commandBuilder.Append(encoding.GetBytes("СПАСИБО ЗА ПОКУПКУ !\n" +
                                                    "МЫ  ОТКРЫТЫ ЕЖЕДНЕВНО С 9 ДО 23\n" +
                                                    "СОХРАНЯЙТЕ, ПОЖАЛУЙСТА , ЧЕК\n" +
                                                    "\n"));

//          commandBuilder.AppendBarcode(encoding      .GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
//          commandBuilder.AppendBarcode(Encoding.ASCII.GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
            commandBuilder.AppendBarcode(Encoding.UTF8.GetBytes("{BStar."), BarcodeSymbology.Code128, BarcodeWidth.Mode2, 40, true);
        }