예제 #1
0
        public static byte[] CreateMultipleData(Emulation emulation)
        {
            byte[] data      = Encoding.UTF8.GetBytes("Hello World.\n");
            byte[] dataHalf0 = Encoding.UTF8.GetBytes("Hello ");
            byte[] dataHalf1 = Encoding.UTF8.GetBytes("World.\n");

            ICommandBuilder builder = StarIoExt.CreateCommandBuilder(emulation);

            builder.BeginDocument();

            builder.Append(data);

            builder.AppendMultiple(2, 2);
            builder.Append(data);
            builder.AppendMultiple(1, 1);
            builder.Append(data);

            builder.AppendMultiple(data, 2, 2);
            builder.Append(data);

            builder.AppendMultiple(dataHalf0, 2, 2);
            builder.Append(dataHalf1);
            builder.Append(dataHalf0);
            builder.AppendMultiple(dataHalf1, 2, 2);

            builder.AppendMultipleHeight(2);
            builder.Append(data);
            builder.AppendMultipleHeight(1);
            builder.Append(data);

            builder.AppendMultipleHeight(dataHalf0, 2);
            builder.Append(dataHalf1);
            builder.Append(dataHalf0);
            builder.AppendMultipleHeight(dataHalf1, 2);

            builder.AppendMultipleWidth(2);
            builder.Append(data);
            builder.AppendMultipleWidth(1);
            builder.Append(data);

            builder.AppendMultipleWidth(dataHalf0, 2);
            builder.Append(dataHalf1);
            builder.Append(dataHalf0);
            builder.AppendMultipleWidth(dataHalf1, 2);

            builder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);

            builder.EndDocument();

            return(builder.Commands);
        }
예제 #2
0
        public override void AppendDotImpact3inchTextReceiptData(ICommandBuilder builder, bool utf8)
        {
            string encoding;

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

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

                builder.AppendCodePage(CodePageType.CP1252);
            }

            builder.AppendAlignment(AlignmentPosition.Center);

            builder.AppendMultipleHeight(Encoding.GetEncoding(encoding).GetBytes("\nCOMERCIAL 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" +
                               "01 2505 CAFÉ DO PONTO TRAD A  1un F1 8,15)\n" +
                               "02 2505 CAFÉ DO PONTO TRAD A  1un F1 8,15)\n" +
                               "03 2505 CAFÉ DO PONTO TRAD A  1un F1 8,15)\n" +
                               "04 6129 AGU MIN NESTLE 510ML  1un F1 1,39)\n" +
                               "05 6129 AGU MIN NESTLE 510ML  1un F1 1,39)\n" +
                               "------------------------------------------\n" +
                               "TOTAL  R$                            27,23\n" +
                               "DINHEIROv                            29,00\n" +
                               "TROCO R$                              1,77\n" +
                               "Valor dos Tributos R$2,15 (7,90%)\n"));

            builder.AppendAlignment(AlignmentPosition.Center);

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

            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"));
        }
        public void AppendDotImpact3inchTextReceiptData(ICommandBuilder commandBuilder, bool utf8)
        {
            Encoding encoding;

            if (utf8)
            {
                encoding = Encoding.UTF8;

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

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

//          commandBuilder.AppendInternational(InternationalType.UK);

            commandBuilder.AppendAlignment(AlignmentPosition.Center);

            commandBuilder.AppendEmphasis(true);

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

            commandBuilder.AppendEmphasis(false);

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

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

            commandBuilder.AppendAlignment(AlignmentPosition.Left);

            commandBuilder.Append(encoding.GetBytes("2014/01/15 13:00\n" +
                                                    "隨機碼 : 9999    總計 : 999\n" +
                                                    "賣方 : 99999999\n" +
                                                    "\n" +
                                                    "商品退換請持本聯及銷貨明細表。\n" +
                                                    "9999999-9999999 999999-999999 9999\n" +
                                                    "\n"));

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

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

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

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

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

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

            commandBuilder.Append(encoding.GetBytes("2014-01-15 13:00\n" +
                                                    "\n" +
                                                    "商品退換、贈品及停車兌換請持本聯。\n" +
                                                    "9999999-9999999 999999-999999 9999\n"));
        }
        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.UK);

            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("COMERCIAL DE ALIMENTOS STAR LTDA.\n"), 2);

            commandBuilder.Append(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"));

            commandBuilder.AppendAlignment(AlignmentPosition.Left);

            commandBuilder.Append(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"));

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

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

            commandBuilder.AppendAlignment(AlignmentPosition.Center);

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

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

            commandBuilder.AppendAlignment(AlignmentPosition.Left);

            commandBuilder.Append(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"));

            commandBuilder.AppendAlignment(AlignmentPosition.Center);

            commandBuilder.Append(encoding.GetBytes("DDDDDDDDDAEHFGBFCC\n" +
                                                    "MM/DD/YYYY HH:MM:SS\n" +
                                                    "FAB:DR0911BR000000275026\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);
        }