Monday, October 20, 2014

Printers

A few notes for those new to Linux printing on how to waste perfectly good trees.

FTP

First walk over to the printer and write down the IP address from the little LCD display.

Many network printers have an unsecured FTP server that your company IT is blissfully unaware of (or more likely, they know only True Card Carrying Geeks will use it in a moment of sheer desperation, so they leave it be, even though it can potentially be abused).  If you upload a postscript file to a printer, it will print it immediately - no questions asked.  This works without having anything special installed on your Linux machine.

The process works something like this:

In your application, select Print to File, then save the file as file.ps.  Open a terminal and connect with FTP, then put the file: 

$ ftp 172.22.8.12
Login: [enter]
Password: [enter]
ftp> put file.ps
ftp> bye

La voila!

CUPS with IPP

The CUPS service is maintained by Apple and it works very well indeed.   Usually, it will discover network printers automatically, but unless your company IT named the printers properly, it won't tell you where the printer is and in a large company there may be hundreds of printers all over the world.  If you cannot figure it out, then you can manually configure a printer.

Open a browser and type localhost:631 to open the CUPS management program.

Go to the Administration screen and select Add Printer.  Select the IPP protocol.  For the URL, type for example ipp://172.22.8.12/ipp/

Enter a printer name and location so you can remember which one it is.  Find the printer manufacturer and device driver, for example HP and HP Laserjet 9040 with CUPS and Gutenprint (en).  If you can't find the exact printer model number, try something similar, it usually works - sometimes you just lose a special feature such as duplex printing that nobody ever use anyway, since it always causes paper jams.

Finally, select Maintenance and print a Test Page.

When you experience printer trouble, restart CUPS from the command line with service cups restart  and then go to the management screen again and clear all the stuck print jobs.

Easy as pie.

LPR

When you have CUPS installed, you can also use the lpr program from the command line.  CUPS can print most types of files automatically.  You don't necessarily need to run a specific application to print something - just send the file to CUPS and it will usually figure it out and convert the file to postscript all by itself.

For example to print to the default printer on your machine:

$ lpr -P localhost file.pdf

It also works with text files and even pictures.  You don't need to fire up a PDF reader or Gimp to print.  You can also pipe multiple files and then go and feed the trees and toner into the printer.

You can likewise use lpr to send a file from a new machine with no configuration, to another machine that already has CUPS installed and print via a proxy.  There is always a simple way to make it work.

No comments:

Post a Comment

On topic comments are welcome. Junk will be deleted.