简体   繁体   English

POS打印机-在.NET中打印

[英]POS Printer - Printing in .NET

If this thread already exists my honest apologies. 如果这个话题已经存在,我诚挚的道歉。

Currently I am in development of some cool EPOS system (at the beginning :)) I have got EPSON TM-T88III Printer and developing everything in C# and .NET 4.5 . 目前,我正在开发一些很酷的EPOS系统(在一开始:)。)我已经有了EPSON TM-T88III打印机,并使用C#和.NET 4.5进行了所有开发。

Currently I am doing the printing in a fashion of printing graphics like so : 目前,我以打印图形的方式进行打印,如下所示:

graphic.DrawString(ord.name, font, b, startX, startY + offset);
offset += (int)fontheight + 5;

but the printer takes time to print stuff. 但是打印机需要一些时间来打印东西。 I would like to get it printed using some king of POS API or something to make it faster. 我想使用某些POS API之王或更快的方法来打印它。 The problem is I don't know where to start and what options are available to me. 问题是我不知道从哪里开始以及我可以使用哪些选项。

Short tutorial to print one two lines of text would be much appreciated ! 简短的教程,打印一两行文字将不胜感激!

Thanks in advance, David 预先感谢大卫

Often when you use printer drivers for dot matrix devices and you are leveraging TTF and other other fonts the device reverts to printing graphics and not text. 通常,当您将打印机驱动程序用于点矩阵设备并且利用TTF和其他字体时,设备会恢复为打印图形而不是文本。 This will make the device print very slowly. 这将使设备打印非常缓慢。 What you want to do is to send raw text along with font selection commands. 您要做的是将原始文本与字体选择命令一起发送。 This will make your application a bit proprietary to that device or devices that speak the same language but will make it much faster. 这将使您的应用程序对使用相同语言的设备或某些设备专有,但会使其速度更快。

Personally, for performance, I would create a large string that contained all the commands to do what you need. 就性能而言,我个人会创建一个大字符串,其中包含执行所需操作的所有命令。 Font select, print text, cr/lf, select font etc. You would simply look to the Epson documentation to determine the correct sequence to trigger the font you want. 字体选择,打印文本,cr / lf,选择字体等。您只需查看Epson文档即可确定触发所需字体的正确顺序。 Using this methodology you would be using 'printer resident' fonts which will be very fast. 使用这种方法,您将使用非常快速的“打印机驻​​留”字体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM