Ano-Tech Computers
Enter keyword:

Sending print jobs from Unix/Linux to a HP JetDirect print server
Problem:
How to let Unix/Linux processes send print jobs to a networked HP printer? Setting up printcap and spooling is near impossible without running X on the server.
 
Solution:
Newer JetDirect adapters supports FTP printing, simply upload the file you want to print.

Alternatively, send the print jobs directly to the printer via the LPR/BSD protocol on port TCP/515. This ancient protocol is supported even by the oldest JetDirect cards and can be used in several different ways.

1. Use LPRng (by far the simplest approach)
"cat printme.txt | lpr -h @192.168.1.2"

2. If you are using Perl, download and install Net::Printer from www.CPAN.org

3. Write your own TCP client that speaks LPR/BSD (The protocol is very very simple)

More information can be found in this excellent tutorial on printing and network print spoolers:
http://www.lprng.org/LISA98.ppt


 
Discuss this solution
Did this article solve your problem? Yes No Did not apply

We welcome anyone who is willing to contribute to this public knowledge base, contact siteadmin@atc.no if you have information you would like to share. The idea is not to replace the commercial support sites, but to publish those hard-to-find solutions you've found yourself looking for over and over again.

Show all articles