【发布时间】:2012-01-21 10:35:37
【问题描述】:
我搜索了很多,我在这里找到了 Posexplorer 的示例,但我的打印机是 USB 并且我读过 PosExplorer 是用于并行的。我不知道如何使用打印机打印以及如何将代码发送到打印机以打开抽屉。
我正在使用以下代码向打印机发送转义序列:
string ESC = Convert.ToString((char)27);
string logo=Convert.ToString(ESC+"|tL");
_oposPrinter.PrintNormal(PrinterStation.Receipt, logo);
_oposPrinter.PrintNormal(PrinterStation.Receipt, "Print example\n");
_oposPrinter.PrintNormal(PrinterStation.Receipt, Convert.ToString((char)27 + "|#fP"));
调试时到达行:
_oposPrinter.PrintNormal(PrinterStation.Receipt, logo);
或
_oposPrinter.PrintNormal(PrinterStation.Receipt, Convert.ToString((char)27 + "|#fP"));
打印机不打印任何东西。
【问题讨论】:
-
将打印机设置为默认打印机(纯文本驱动程序)并像打印任何其他文档一样打印。要打开抽屉,您需要能够访问 COM 端口并知道要发送什么信号。
-
谢谢,我已经用这种方式打印了,但我需要打开抽屉。无论如何,谢谢。
标签: c# thermal-printer pos-for-.net