Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there such a thing as a virtual COM port receipt printer? [closed]

I'm debugging some code that writes directly to a COM port in order to print receipts on a receipt printer. The printer model is something like an Epson TM-88.

Instead of printing reams of thermal paper while debugging this code, it would be nice if I could use some kind of virtual printer.

Like PDFCreator or FinePrint, but with a virtual COM port instead of a virtual windows printer.

Does anyone know of such a thing?

Edit: The code sends control characters to get bold text and other formatting. I'd like to see this in the output if possible.

like image 748
Blorgbeard Avatar asked Apr 22 '09 03:04

Blorgbeard


3 Answers

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.

like image 52
Scott Whitlock Avatar answered Sep 21 '22 17:09

Scott Whitlock


Microsoft's free Virtual PC lets you direct a guest virtual machine's COM port to a file on the real machine.

like image 28
Windows programmer Avatar answered Sep 20 '22 17:09

Windows programmer


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.

like image 36
Adam Robinson Avatar answered Sep 21 '22 17:09

Adam Robinson