
You need to adjust the -w parameter to the width of your own printer (mine is obviously 32 characters wide). I have called mine “thermof” (thermoFormated):įmt -cu -w32 –goal 30 | unix2dos | iconv -c -f UTF-8 -t 437 > /dev/usb/lp0įmt will eliminate line wraps which don’t match with your printer width and add new ones at the correct positions. You might also want to reformat a text file to match the short lines of the printer. You might want to create a “thermotest” script without -c and actual printer output to make sure all characters can be printed before you attempt to print. The -c option makes sure that characters which can’t be printed are ignored rather than cause an error and stop. Iconv simply translates UTF8 into the common printer default codepage 437.

Unix2dos makes sure the printer receives CR+LF at every new line. Then press “Enter” and “Strg+d” to stop editing and start printing.

Now you can just copy your text and then type “thermo” into a console and press “Shift+Ins” and/or type whatever you want to print. I named my script “thermo” and deposited it into /usr/bin. Unix2dos | iconv -c -f UTF-8 -t 437 > /dev/usb/lp0 You can create a simple script to be able to print TXT files or dump text to the printer using copy&paste: This would be sent to the printer by loading it from the web, or running the script on the command-line: php foo2.php $printer -> setJustification(Printer::JUSTIFY_CENTER) $printer -> text("Receipt for whatever\n") The above example would be written using escpos-php as: setEmphasis(true) The codes are quite tricky to work with manually, which is why I put together the escpos-php driver.

#EPSON PRINTER DRIVERS FOR LINUX DRIVER#
blacklist a vendor driver which has claimed the interface.
#EPSON PRINTER DRIVERS FOR LINUX INSTALL#

usblp 8-4:1.0: usblp1: USB Bidirectional printer dev 5 if 0 alt 0 proto 2 vid 0x04B8 pid 0x0E03 usb 8-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 8-4: New USB device found, idVendor=04b8, idProduct=0e03 usb 8-4: new full-speed USB device number 5 using ohci-pci Plug in your printer, and check that usblp sees it: dmesg The directions below are for Debian, but could be adapted for any other Linux.
