如何在c#热敏打印中使用EPSON / POS打印机命令? [英] how to use EPSON/POS printer commands in c# thermal printing?

查看:933
本文介绍了如何在c#热敏打印中使用EPSON / POS打印机命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述







我想用c#中的ESC / POS命令设置字体大小,方法是将其改为十六进制值。使用escape作为



bw.Write(AsciiControlChars.Escape)。



但是当我尝试使用改变字体大小时没有得到,



bw.Write(AsciiControlChars。 Escape +。+(byte)'!'+。+ AsciiControlChars.Line);

bw.Write(hai);

class如下,



命名空间PurchaseDetailsPrint

{



公共静态类AsciiControlChars
{

public const char Escape =(char)0x1B;



public const char Horizo​​ntalTab =(char)0x09;



public const char Line =(char)0x38;



}

}



我的打印机是EPSON TM-T81收据



谢谢



谢谢..

Hi,


i am trying to set font size with ESC/POS commands in c# by change it to hex value. use escape as

bw.Write(AsciiControlChars.Escape).

but not getting when i try to change font size using,

bw.Write(AsciiControlChars.Escape+" . " +(byte)'!'+" . "+AsciiControlChars.Line);
bw.Write("hai");
class as below,

namespace PurchaseDetailsPrint
{

public static class AsciiControlChars
{
public const char Escape = (char)0x1B;

public const char HorizontalTab = (char)0x09;

public const char Line = (char)0x38;

}
}

my printer is EPSON TM-T81 Receipt

Thanks

Thanks..

推荐答案

您需要使用额外的反斜杠。看看这里:

在C#中转义:字符,字符串,字符串格式,关键字,标识符 [ ^ ]



祝你好运!
You need to use an extra backslash. Have a look here:
Escaping in C#: characters, strings, string formats, keywords, identifiers[^]

Good luck!


这篇关于如何在c#热敏打印中使用EPSON / POS打印机命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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