Beispiel #1
0
        public void Append4inchTextReceiptData(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, Enterprise Square 2,\n" +
                                                    " 3 Sheung Yuet Road, 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        交易编号 : 88888\n" +
                                                    "\n"));

            commandBuilder.AppendAlignment(AlignmentPosition.Center);

            commandBuilder.Append(encoding.GetBytes("收银机 : 001  收银员 : 180\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-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);
        }