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.
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'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 you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With