Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
COM 端口重定向器 的 Wikipedia 页面底部有一个开源和免费软件工具列表,可以重定向串行端口,并且您可以为打印机编写自己的简单模拟器。
如果收据打印机与我使用过的 Zebra 或 Intermec 打印机类似,那么其格式只是一些 ASCII 格式的打印命令。 例如,Intermec 打印机使用 Intermec 打印机语言 (IPL)。 就 Epson POS 打印机而言,它看起来使用一种称为 ESC/POS 的语言。 这是另一个答案,其中包含更多信息。 顺便说一句,这是 ESC/POS 命令规范。
请问,硬件自带的驱动是Windows打印机驱动吗? 如果是这种情况,您难道不能使用 CutePDF 打印到 PDF 文件? 当您按照自己喜欢的方式得到它后,就可以使用实际的打印机进行最终测试。
The Wikipedia page for COM Port Redirector has a list of open source and freeware tools at the bottom that can redirect serial ports, and you can probably write your own simple emulator for the printer.
If the receipt printer is anything like the Zebra or Intermec printers I've used, then the format is just some print commands in ASCII. For instance, Intermec printers use the Intermec Printer Language (IPL). In the case of Epson POS printers, it looks like it uses a language called ESC/POS. Here's another answer with more info. By the way, here's the ESC/POS command specification.
May I ask, is the driver that comes with the hardware a Windows printer driver? If that's the case, couldn't you do all your testing by using something like CutePDF that prints to a PDF file? When you get it just the way you like it, then do your final testing with the actual printer.
Microsoft 的免费 Virtual PC 可让您将来宾虚拟机的 COM 端口定向到真实计算机上的文件。
Microsoft's free Virtual PC lets you direct a guest virtual machine's COM port to a file on the real machine.
您可以编写一个简单的应用程序来模拟打印机的行为,并在通过零调制解调器电缆连接的另一台计算机上运行它。
You could write a simple application that emulates the behavior of the printer and run it on another machine connected by a null modem cable.
如果只是将原始数据打印到输出文件,为什么不简单地添加虚拟打印机并将端口配置到文件呢? 当您的代码调用打印机时,文本框将打开,您可以在其中提供文件名。
If just about printing raw data to a output file, why don't you simply add a virtual printer and configure the Port to a FILE ? When your code calls the Printer and text box will open where you can provide a File Name.
尝试 HHD 免费串行端口监视器和 VSPE 免费串行端口模拟器。 我正在尝试直接打印到屏幕上的虚拟收据打印机,但发现这些工具也很有用。 HHD 以多种不同方式显示数据流以及输出的控制台视图。
Try HHD Free Serial Port Monitor and VSPE Free Serial Port Emulator. I am trying to print direct to a virtual reciept printer on screen but found those tools useful as well. HHD shows data flow in several different ways plus a console view of output.