在 Epson TM-T88IVM 上打印简体中文字符

标签 printing point-of-sale opos epson

我正在尝试使用 C# 中的 Microsoft 服务点 SDK 在 Epson TM-T88IV M(并行端口)上打印中文字符。但是,它们在打印机上显示为问号。 (?)

我的 PosPrinter 具有以下有效 CharacterSetList :
255,437,850,852,858,860,863,865,866,936,998,999,1252

以及以下 CapCharacterSet:汉字

代码页 1252 是默认的 Windows 代码页。 936是简体中文的代码页。在本例中,我使用的是代码页 936,但一直无法在打印机上显示中文字符。

例子:

string str = "重新开始";
// open device as variable _ReceiptPrinter, claim it, mark it as enabled 
_ReceiptPrinter.CharacterSet = 936;
_ReceiptPrinter.PrintNormal(PrinterStation.Receipt, str);

这将打印出所有中文字符替换为 ? 的文本。

我不确定是否需要在打印前指定额外的转义码(ESC R 15?),或者我的打印机在 Epson OPOS (v2.50e) 中是否配置错误。我尝试了很多东西,但没有任何效果。任何想法或代码示例?

注意:在自检中,打印机确实打印汉字。

最佳答案

Epson TM-T88IV Multilingual 要求您将字符串转换为 CodePage 936,然后在 ISO-8859-1 中表示该字符串。

有关算法的详细信息,请参阅另一个问题:

Can we simplify this string encoding code

在发送到打印机之前执行此操作。
str = Encoding.GetEncoding("ISO-8859-1").GetString(Encoding.GetEncoding(_ReceiptPrinter.CharacterSet).GetBytes(str));

关于在 Epson TM-T88IVM 上打印简体中文字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1941988/

相关文章:

windows - Webusb:尝试在 Windows 上打开打印机时访问被拒绝

iphone - UIPrintInteractionController 返回 UIPrintUnknownImageFormatError

javascript - 避免第一页的边距 - 打印

javascript - Odoo POS javascript 变化

javascript - Odoo 销售点如何使用 JS 访问模型和调用方法

c# - OPOS Configuration.xml DevicePath 属性

c# - Esc pos 打印条形码

使用 Epson TM-C3500 无法进行 90x20mm 图像的 Java 打印

java - 打印 JTextArea 换页字符作为分页符

c# - OPOS PosPrinter.PrintNormal 不打印