![]() :) It takes me the whole day to finally succeed on printing over the network. The problem is that cowsay removes all blank lines and combines lines even separated by multiple CR so while it is nice to print out adresses, phone numbers and brief memos, it can’t be used to print proper lists or even tables! I use this script I call “thermotux” to print short messages to coworkers:Ĭowsay -W28 -f tux | unix2dos | iconv -f UTF-8 -t 437 -c > /dev/usb/lp0 But it prints a nice ASCII-Art box around your text. A goal of 2 characters less than the printer width gives you maximum densityĬowsay can accomplish the same as fmt but not as good. You can use –goal to make the print more dense to safe paper rather than more easy to read. 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
0 Comments
Leave a Reply. |