如何使用C#将命令发送到Bixolon热敏打印机 [英] How to Send commands to Bixolon thermal printer using c#

查看:108
本文介绍了如何使用C#将命令发送到Bixolon热敏打印机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我在Google上进行了搜索,但是没有使用c#可以发送打印机命令的示例代码.

我正在尝试向Bixolon热敏打印机发送命令,例如

First of all , I have searched on Google but there is no sample code using c# by which printer commands can be sent.

I am trying to send commands to printer such as

ESC c 3

到打印机.如果纸张中的纸卷即将用完,该命令将发出纸用完信号.我找到了一些其他命令的VB6代码,但在c#上不起作用.我什至在项目中添加了Microsoft.VisualBbasic.PowerPacks.Vs.dll以发送
打印机命令

to Bixolon thermal printer. The command will signal paper end if paper roll in the paper is about to end. I found some VB6 code for other commands but it doesn''t work on c#. I even added a Microsoft.VisualBbasic.PowerPacks.Vs.dll to the project to send
commands to printer

using Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6;

Printer printer = new Printer();
printer.Print("\x1B\x63\x33");
printer.Write("\x1B\x63\x33");

printer.EndDoc();



可以在此处找到Bixolon命令手册 [



Bixolon command manual can be found here[^]
A sample code would be very helpful. Thank you in Advance...

推荐答案

使用以下示例:
Use the following sample :
SerialPort comPort = new SerialPort("COM1",2400); // change the parameters to your printers specs.
comPort.Open();
comPort.Write("\x1B\x63\x33"); // write to your printer here
comPort.Close();



您可能想要根据上述代码创建一个用于处理打印机的类,以发送多个命令等.



You would probably want to create a class for handling your printer from the above code to send multiple commands etc.


您好,Praveen Kullu

尝试以下操作可能对您有所帮助.
->将您的数据写入要预压缩的文本文件中
即\ x1B \ x63 \ x33等...
->创建一个批处理文件
http://www.robvanderwoude.com/printfiles.php [ http://stackoverflow.com /questions/394036/how-to-execute-a-bat-file-from-ac-windows-form-app [ http://forums.asp.net/t/1444055.aspx/1 [ ^ ]
Hi, Praveen Kullu

try the following may be helpful to you.
-> Write your data in text file which you want to pring
i.e. \x1B\x63\x33 etc...
-> Create one batch file http://www.robvanderwoude.com/printfiles.php[^]

-> Run batch file http://stackoverflow.com/questions/394036/how-to-execute-a-bat-file-from-a-c-windows-form-app[^]
http://forums.asp.net/t/1444055.aspx/1[^]


这篇关于如何使用C#将命令发送到Bixolon热敏打印机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆