如何在c#中使用esc/pos命令?

 dazhi20 发布于 2023-01-31 14:07

如何在C#中使用ESC/POS命令?我需要这样的格式在此输入图像描述

但我无法实现这种格式.我尝试了一些代码,但没用.

using (var ms = new MemoryStream())
    using (var bw = new BinaryWriter(ms))
    {
        // Reset the printer bws (NV images are not cleared)
        bw.Write(AsciiControlChars.Escape);
        bw.Write('@');
        bw.Write(AsciiControlChars.Newline);
        bw.Write(AsciiControlChars.Escape);
        bw.Write("_______________________________________________");
        bw.Write(AsciiControlChars.Newline);

        bw.Write("Service           Price         Qty       Total");
        bw.Write("------------------------------------------------");

        bw.Write(AsciiControlChars.GroupSeparator);
        bw.Write('V');
        bw.Write((byte)66);
        bw.Write((byte)3);
        bw.Flush();
        // Send the converted ANSI string to the printer.
    }

小智.. 7

你可以查看这个链接.我现在使用它和它的工作!

http://www.codeproject.com/Tips/704989/Print-Direct-To-Windows-Printer-EPOS-Receipt 小心使用,您必须知道热敏打印机的ESC/POS命令.如果我没弄错,手动命令必须退出打印机附带的CD.

亲切的问候

额外奖励:http: //www.developerfusion.com/tools/convert/vb-to-csharp/

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有