如何使用Star DP8340打印收据? [英] How print receipt with Star DP8340?

查看:97
本文介绍了如何使用Star DP8340打印收据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发的软件也需要使用打印机Star DP8340SD。

我正在使用Windows 7 32位的.Net Framework 4进行C#开发。

我通过适配器25到9针和RS232-USB连接打印机。

转换器和打印机的驱动程序已正确安装(对于打印机驱动程序,我尝试了两个linemode_2k-xp_20090529那个SP298_LineMode-Drv_XP-7_20110414)

我通过RawPrinterHelper(https://support.microsoft.com/en-us/kb/322091)尝试了PrintDocument(https://msdn.microsoft。 com / en-gb / library / system.drawing.printing.printdocument%28v = vs.110%29.aspx?f = 255&MSPPError = -2147217396)但没有结果。



您对如何使用.NET中的DP8340进行打印有什么建议吗?



谢谢!

解决方案

如果您将它安装为打印机,那么您不想使用原始数据 - 您希望将其视为打印机并让驱动程序执行此操作 译文。这意味着使用 PrintDocument [ ^ ]而不是原始打印机助手。



如果你我真的想要使用原始助手,然后你必须开始寻找有关实际打印机首先预期的数据的信息,并证明你可以在开始编码之前以该格式发送可打印数据。



所以谷歌提供操作手册(或技术,如果你能找到)并找出你要发送的东西 - 它可能不会像你好世界!那样简单。 / blockquote>

如果打印机只是连接到RS232端口和未知的窗口(没有驱动程序)。

驱动打印机的唯一方法是直接发送命令s通过RS232 IO。



说不然,你必须自己发送打印机语言的每个推荐,在这种情况下,Windows无法帮助你。



如果Windows知道打印机,我怀疑你会遇到问题。

问题是windows打印图形,并且griphics很大但是RS232是慢。



我的建议:自己建立打印所需的一系列表扬并将其发送给打印机。您将需要阅读打印机手册以获得赞誉。


解决方案是定制电缆......!

Star DP8340打印机有一个自定义串行电缆DB25-to-DB9,我构建它并发送ASCII字符串和打印机命令,一切正常,即使使用USB-RS232转换器。



感谢所有人提示!

I'm developing software that also requires the use of printer Star DP8340SD.
I'm developing in C # with .Net Framework 4 on Windows 7 32-bit.
I connected the printer via an adapter 25 to 9 pin and a RS232-USB.
The driver of the converter and printer have been installed correctly (for the printer driver I tried both linemode_2k-xp_20090529 that SP298_LineMode-Drv_XP-7_20110414)
I tried both through RawPrinterHelper (https://support.microsoft.com/en-us/kb/322091) that PrintDocument(https://msdn.microsoft.com/en-gb/library/system.drawing.printing.printdocument%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396) but without results.

Do you have any advice on the subject of how to print with the DP8340 in .NET?

Thanks!

解决方案

If you have it installed as a printer, then you don;t want to use Raw Data - you want to treat it as a printer and let the driver do the translation. That means using a PrintDocument[^] instead of a raw printer helper.

If you really want to use a raw helper, then you will have to start looking for info on what data the actual printer expects first, and prove you can send "printable" data in that format before you even start to code.

So Google for an operations manual (or technical if you can find one) and work out what you have to send - it probably won't be as simple as "hello world!"


If the printer is simply connected to RS232 port and unknown of windows (no driver).
The only way to drive the printer is to send directly commends via RS232 IO.

Said otherwise, you have to send every commend in the printer language yourself, windows can't help you in this case.

If windows know the printer, I suspect that you will have a problem .
The problem is that windows print graphics, and griphics are big but RS232 is slow.

My advice: build yourself the sequence of commends needed for your printing and send it to the printer. You will need to read the printer manual to get the commends.


The solution was the custom cable ...!
Star DP8340 printer has a custom serial cable DB25-to-DB9, I built it and send ASCII strings and printer commands, and everything works, even with the USB-RS232 converter.

Thanks to everyone for the tips!


这篇关于如何使用Star DP8340打印收据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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