sunmi打印小票测试

本来打算2020都不写博客的,因为太忙了,一直在项目。不是在项目的策划中,就是在项目的实现中;不是在项目的实现中,就是在项目修复bug中;不是在项目的修复bug中,就是在项目的新增需求中;  项目,项目还是项目,循环往复无穷尽也。坑也罢,路也罢,任他东西南北龙卷风,博客还是要不断进行中... 哈哈哈

sunmi打印小票测试代码:

public void printerTest(){
        SunmiPrintHelper.getInstance().print3Line();
        SunmiPrintHelper.getInstance().setAlign(1);
        SunmiPrintHelper.getInstance().printText("积分兑换小票\n", 36, true, false);
        SunmiPrintHelper.getInstance().printNumLine(1);
        SunmiPrintHelper.getInstance().setAlign(0);
        SunmiPrintHelper.getInstance().printText("************************\n", 32, true, false);
        SunmiPrintHelper.getInstance().printText("姓名:张飒\n", 32, true, false);
        SunmiPrintHelper.getInstance().printText("地址:大陆村123号\n", 32, true, false);
        SunmiPrintHelper.getInstance().printText("电话:123****5678\n", 32, true, false);
        SunmiPrintHelper.getInstance().printText("日期:2020年8月19日\n", 32, true, false);

        String txts[] = new String[]{"商品", "数量", "积分"};
        int width[] = new int[]{1, 1, 1};
        int align[] = new int[]{0, 1, 2};
        SunmiPrintHelper.getInstance().printNumLine(1);
        SunmiPrintHelper.getInstance().printText("************************\n", 32, true, false);
        SunmiPrintHelper.getInstance().printTable(txts, width, align);
        SunmiPrintHelper.getInstance().printText("************************\n", 32, true, false);
        txts[0] = "酱油";
        txts[1] = "1";
        txts[2] = "350";
        SunmiPrintHelper.getInstance().printTable(txts, width, align);
        txts[0] = "拖把";
        txts[1] = "1";
        txts[2] = "500";
        SunmiPrintHelper.getInstance().printTable(txts, width, align);
        txts[0] = "扫把";
        txts[1] = "1";
        txts[2] = "500";
        SunmiPrintHelper.getInstance().printTable(txts, width, align);

        SunmiPrintHelper.getInstance().printText("************************\n", 32, true, false);

        txts[0] = "合计";
        txts[1] = "";
        txts[2] = "1350";
        SunmiPrintHelper.getInstance().printTable(txts, width, align);
        txts[0] = "剩余";
        txts[1] = "";
        txts[2] = "150";
        SunmiPrintHelper.getInstance().printTable(txts, width, align);

        SunmiPrintHelper.getInstance().printNumLine(1);
        SunmiPrintHelper.getInstance().setAlign(1);
        SunmiPrintHelper.getInstance().printText("谢谢惠顾!\n", 30, true, false);
        SunmiPrintHelper.getInstance().setAlign(0);

        SunmiPrintHelper.getInstance().printNumLine(6);
        SunmiPrintHelper.getInstance().cutpaper();
    }

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值