views:

600

answers:

4

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 Epsom 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.

+1  A: 

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

Windows programmer
True, I could just redirect it to a file, but I'd like to see formatting from control codes
Blorgbeard
A: 

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.

Adam Robinson
A: 

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.

Scott Whitlock
A: 

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.