使用C#打印热敏打印机 [英] Print using C# for thermal printer

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

问题描述

我是POS收据打印的新手。一旦交易完成,我的应用程序应该使用来自DataGridView的XPrinter POS 80C为客户打印收据,其中包含以下项目:产品名称,数量,小计,总计,交易日期和员工登录ID。 />


我们将非常感谢您的协助。

最好的问候



我尝试了什么:



我尝试过使用DGVPrinter.cs;是的,它成功地从XPrinter POS 80c机器打印出一张收据,但收据没有按照我的DataGridView到ms SQL Server 2014的上述项目进行组织。那么,我是否需要一个打印模块来执行此任务?我很困惑。

我在youtube上使用谷歌搜索和视频教程,但无法获得任何合适的帮助主题。

I am new to POS receipt printing. Once, a transaction is complete, my application should print a receipt for the customer using XPrinter POS 80C from a DataGridView with the following items: product name, quantity, subtotal, grand-total, transaction date, and the staff login id.

Your assistance will be greatly appreciated.
Best Regards

What I have tried:

I tried using DGVPrinter.cs; yes, it successfully printed out a receipt from the XPrinter POS 80c machine but the receipt was not organized with the afore-mentioned items from my DataGridView through ms SQL server 2014. So, do i require a print module for this task? I am so confused.
I have used google search and video tutorials on youtube, and couldn't get any suitable help topic on this.

推荐答案

您需要做的是设置 PrintDocument [ ^ ]并选择热敏打印机作为目标。



然后,您可以为要打印的每张收据处理PrintPage事件,并根据需要在打印机上格式化信息。文档中有一个链接到 PrintDocument.PrintPage事件(System.Drawing.Printing)| Microsoft Docs [ ^ ]其中包含一个基本示例。
What you need to do is set up a PrintDocument[^] and select your thermal printer as the target.

You then handle the PrintPage event for each receipt you want to print, and format the information exactly as you want it on the printer. There is a link in the document to the PrintDocument.PrintPage Event (System.Drawing.Printing) | Microsoft Docs[^] which includes a basic example.


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

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