script You currently have JavaScript disabled. This site requires JavaScript to work properly.
For more details on how this site uses JavaScript see the JavaScript page.
 
ZXnet http server: Note N00019: Printing with NetCat

Menu:

Archives:
Note Archive
Information
Number: N00019
Created: 28 May 2008
Revised: 28 May 2008

One can bypass all the annoying formatting that printer drivers and software insert in to a document by printing straight to network printers using netcat. I do this when printing on an old dotmatrix printer so that its control panel buttons actually do something, etc.

To print with netcat just do something like:

cat filename.txt | nc 192.168.0.252 9101
             

where 192.168.0.252 is the hostname/IP Address of the print-server and 9101 is the port number. Some print servers may require you to Ctrl+C netcat before they will finish printing. If the printer just stops printing shortly before the end of a document and netcat hasnt exited, terminate it and the print server should finish printing what ever was left in its buffer.