Printing with CUPS, Part 2 - Page 2
Windows Clients
Windows 98, ME, 2000, and XP clients will happily print directly to a CUPS printer, via IPP. IPP may need to be installed on 98 and ME (see Resources for additional information). Once you've ensured IPP is installed, simply fire up the Add Printer wizard, select Network Printer, and then add the printer URL. This consists of the IP address or server name, port number, and printer name. Be sure to use the exact name you gave the printer, like this:
http://192.168.1.2:631/printers/hplaserjet
In Windows 2000/XP, this should be sufficient for adding a network printer, but if it does not connect, try these steps:
- Add a printer port, using the exact printer URL as the port designation
- Add TCP/IP Print Services (Network and Dial-up Connections-> Advanced Menu -> Optional Networking Components -> Other Network File and Print Services)
- It never hurts to reboot and then try the connection again
CUPS can also connect to a Windows 2000 print server. Here's how to enable this:
- Enable TCP/IP Print Services on the Windows 2000 machine: Administrative Tools ->Services -> TCP/IP Print Server -> Startup Type Automatic
- Set up sharing and permissions on the printer
- Add the printer to CUPS, selecting LPD/LPR Host. The deviceURI is lpd://[IP or server name]/[shared printer name]
- Select the driver, and away you go
Linux Clients
Make it easy on yourself — use CUPS on all of your Linux/Unix clients. Each CUPS installation contains the server and the client, giving complete functionality to the clients.
Most printing is done from within applications. Linux applications vary wildly in their levels of printing support. This is mainly due to the fragmented Unix heritage of having several different printing subsystems, which were difficult for application developers to support. CUPS aims to provide a standard printing platform for all flavors of Unix and Unix-type operating systems. CUPS also adds printing options that may not otherwise be available when printing from inside an application.
For example, this article was written in Abiword, which has only a basic printing menu. Fortunately, it provides for additional commands on the "printer command" line in the print dialogue box. This command specifies the printer, and prints odd pages only:
lpr -P epson600 -o page-set=odd
Here's a fun one that prints multiple pages on a single page, shrunk to fit. I use this for proofreading to save paper. (Of course, I'm sure my aging eyeballs will someday make this a non-option for me.) Available quantities are 1, 2, 4, 6, 9, and 16:
lpr -o number-up=4
Command-Line Printing
As you can see, CUPS supports the familiar old System V (lp) and Berkeley (lpr) commands. Any file format supported directly by CUPS, such as text, PostScript, PDF, HP-GL/2, and most image files, can be printed directly from the command line:
$ lpr fake_document.pdf
Unsupported file formats, such as .abw, need to be printed from inside the applications that created them. CUPS will obligingly print them directly, but the output will consist of gibberish.
$ lpadmin -d [printer_name] sets the default printer, when more than one is available
$ lpstat -p -d displays the available printers
$ lp -d [printer_name] [filename] selects the printer
$ lpstat -o -p displays current jobs and job IDs
$ cancel [job-id] cancels print jobs
There are zillions more command-line print options; please see the CUPS Software User's Manual for additional options.
Conclusion
CUPS is a rich, full-featured printing system, good for small standalone systems or for supporting large operations. Printing on any platform is a large, complex subject. Please see the documentation and mail lists specific to your Linux distribution for help. Listed below are more comprehensive sources of help and information. The KDEPrint site is especially helpful for understanding the underlying protocols and concepts.
Resources
Easy Software Products
Linuxprinting.org
HP Glossary of Printing Terms
KDEPrint
Windows ME and IPP
Gimp-Print for OS X
» See All Articles by Columnist Carla Schroder



