Taming the Horrors of Printers and Printing, Part 4
Hello everyone, and welcome back to Sysadmin's Corner, where nothing is impossible and system administration can even be fun.
For those who are new to Linux, one of the most difficult things to wrap your head around is the idea of choice. Oh, sure, you can get lots of different word processing packages for Windows and for Linux. The difference is that with Linux, doing things differently goes right down to the bone. I can rebuild my kernel to take advantage of little-known, super-cool performance enhancements. I can change the way I talk to every device hooked up to my system. I can even decide how I want to print. One gives you choices, the other gives you CHOICES! That's not always easy for the new Linux user to get used to.
Printing is what we are talking about, and this is where I will turn this analogy. If you are running Windows, you simply do your Settings-Printers thing and away you go. Along comes Linux, which says, "Well, you could print using the standard lpd system, or LPRng, or IPP, or CUPS, or PDQ. Oh, and you can use Red Hat filters, and custom bash filters, and ghostscript filters, and..." Choice is a hard thing to get used to, but once you do get the hang of options, they become an addiction that's good for you and good for the software industry as a whole.
Last week, I said I would re-visit filters one more time. That's only partly true, in that some of the things I want to talk about aren't specifically filters, and that whole choice thing has me rethinking things all the time. Some of you sent me thank-you e-mails for giving your HP 7xx series printers a second chance on your Linux server. A couple of people even said this "WinPrinter" problem was the last holdout to them switching entirely over to Linux. Hey, I'm just a force for good in my time. (Should I include a smiley here? Nah.)
People talk about getting "stuck" or "caught" with a printer that doesn't work. When I bought my HP710C printer, I just assumed (ouch!) that anything from HP would work with Linux. After all, they make that great OS, HP-UX. It's easy to be wrong. If you find yourself looking at a new printer and wondering whether it is a good idea for your Linux system, there's the ever-popular hardware compatibility list, but for printers, it gets better. Check out Grant Taylor's printer compatibility list at http://www.picante.com/~gtaylor/pht/printer_list.cgi.
Scroll down to the bottom of this page, and you'll find one of the coolest things about Grant's resource. For instance, you can select a particular manufacturer and get a list of all printers made by them, what level of support they offer, and what you might need to do to make them work. This is a good thing if you already have a particular printer and you want to know what filter or drivers are out there for your Linux system. Let's pretend I have a Canon BJC2000 series printer, and I want to know whether it would work. By choosing "all printers made by Canon" and clicking on "Go", the next page would tell me that the BJC2000 works "almost perfectly". If I click on the link representing the printer itself, I get even more information. In fact, the detail page tells me that my best bet with this printer, using ghostscript, is with this device option:
The less adventurous (who haven't already spent the money on a printer) can use the safer reporting option on the first page. Simply ask to see which color inkjet printers (or laser printers or whatever) work perfectly. The resulting report lists these printers by manufacturer, with appropriate links to detailed descriptions of individual models.
I want to go back to this whole idea of choosing your print system (and, in effect, the filters). One of the coolest printing options I've run across is something called PDQ. According to the author, Jacob A. Langford, it stands for "print, don't queue" and a variety of other acronyms. His page is at http://feynman.tam.uiuc.edu/pdq/.
PDQ is a nice, friendly little package that works on Linux and a variety of other UNIX systems. I'm not sure I agree a hundred percent with Jacob's reasoning on printing, accounting and queueing, but that doesn't detract from PDQ's value. While it seems quite capable of dealing with large deployments of printers, what I particularly like about PDQ is that it presents the kind of friendly face which users of that other operating system find so appealing, complete with a slick X-Windows-like interface and "wizards" to help you set up your printers quickly and easily. You can even use Grant Taylor's compatibility list to find the latest PDQ drivers and filters in his PDQ-O-Matic section.
Downloading the PDQ source and installing is easy. The latest release at this time is pdq-2.1.2. All I had to do was untar and unzip, then do a make. followed by a make install. Like this:
tar -xzvf pdq-2.1.2.tgz cd pdq-2.1.2 make make install
Now set up a base printrc configuration file, like this:
mv /etc/pdq/printrc.example /etc/pdq/printrc
To start PDQ and configure your first printer, simply type this command:
When the interface comes up, click on "Printer", then choose "Add" and follow the steps in the printer wizard. When you move your mouse over a field, PDQ also has context-sensitive "bubble" help to guide you.
When you get the driver selection screen, you may find that list somewhat limited--only about a dozen printers are listed, although you may be able to use a generic definition. For my HP LaserJet 5L, I went back to Grant Taylor's printer compatibility list, found my printer, and clicked on the PDQ-O-Matic list. To install this new driver, I did the following:
In the drivers directory, there are subdirectories for the printer classes (or brands, if you prefer). After changing to the hp directory, I used vi (you can use emacs, pico, or whatever editor you prefer) and simply cut and pasted the information on the PDQ-O-Matic screen. Then I restarted xpdq, and my printer was now in the list.
To print a job using PDQ, you send the job via the command line (did I mention there are command-line utilities that let you do what the X interface does?). The format is simple. For my test, I even sent a Postscript file. I wanted to see PDQ's drivers and filters in action.
pdq -P hp5lj /tmp/oneliners.ps
The -P flag calls the printer name as you defined it in the wizard, while /tmp/oneliners.ps is my very important print file. The X interface (xpdq) then reports the status of the job, and even allows me the opportunity to reprint it, get a status on it (if it is deep in the list of jobs) or get information on the type of job.
Another alternative to good old-fashioned lpd printing is CUPS. CUPS, or the Common Unix Print System, is designed to be a platform-independent printing system that works across many different UNIXes (or Unices, if you prefer). The company which produces CUPS (Easy Software Products) distributes it under the GPL, but you should be aware that the number of print drivers is limited. For large printer support, you should consider their ESP Print Pro, a commercial offering which includes CUPS, lots and lots of printer drivers and a really cool GUI. If you want to explore CUPS, follow this link: http://www.easysw.com
CUPS uses the Internet Printing Protocol (IPP), a next-generation printing system aimed at replacing LPD with a "universal" printing environment, where any user anywhere could print to any printer anywhere. It also aims to provide better authentication and security. The proposed standard would even allow for encrypted print jobs. Those who are really curious as to where this is going can visit the Printer Working Group at http://www.pwg.org.
As I mentioned, CUPS has limited printer support in its free package; however, some popular printers are supported. If you want to go this route but prefer to stick to the freeware version (and you may use the provided drivers), you can still get a nice GUI by running KDE as your desktop. Just get your hands on KUPS from cuendet, available at http://cups.sourceforge.net.
There you have it. Despite rumors to the contrary, there are ways to simplify printing and make it more (ahem) Windows-like in friendliness. Your basic lpd printing and ghostscript are still important, in that you will find them on every Linux system you install. Red Hat print filters won't necessarily be there, and neither will somebody else's printing method. Many of the alternatives employ these standards, so knowing what's under the hood does not hurt.
So, that's it. I've gone on long enough for this week. Electrons don't come cheap, you know! Until next time, "Print lightly and carry a big toner cartridge."
- Three More Lessons
- Django Models and Migrations
- August 2015 Issue of Linux Journal: Programming
- Hacking a Safe with Bash
- The Controversy Behind Canonical's Intellectual Property Policy
- Secure Server Deployments in Hostile Territory, Part II
- Shashlik - a Tasty New Android Simulator
- Huge Package Overhaul for Debian and Ubuntu
- Embed Linux in Monitoring and Control Systems
- KDE Reveals Plasma Mobile