I need to print a receipt from my web based apps using dot matrix printer epson tm-u220d (pos printer).
I need to know, should I generate the receipt in html or in plain text ?
I ever saw some commands for dot matrix printer to change the font size, line feed etc .. but I don’t remember that commands. if I have to use plain text I need to use that commands. anyone knows where i can get the references ?
Thanks
There is a very good chance that these printers support Esc/P2 which was the Escape codes required to do some formatting on the printer…Here’s a link to the RawPrinterHelper…
How are you connected to the printer? Parallel, USB, You may need to add a generic text print driver to allow the means of writing raw escape code sequences to be sent to the printer…for an example, here’s an example code that needs to be sent to the printer, depending on how you implement this, to give additional flexibility, the class could parse for simple html codes and re-interpret them as Esc/P2 codes
This will be printed in bold | V 0x1b0x69This will be printed in bold0x1b0x700x1b is Escape, 0x69 is E (Turns on Bold)
0x1b ‘ ” , 0x70 is F (Turns off Bold)