Improving the GNU/Linux print supportFeb 12, 2001, 21:01 (4 Talkback[s])
(Other stories by Kurt Pfeifle)
WEBINAR: On-demand webcast
How to Boost Database Development Productivity on Linux, Docker, and Kubernetes with Microsoft SQL Server 2017 REGISTER >
[ Thanks to Kurt Pfeifle for this announcement: ]
Call For Support:
Collection Of Valid PJL Commands For All Printers By "Linuxprinting.org"
Every user with a printer can help to achieve a better Linux print support. Wanna help out?
PJL And The Linuxprinting Database
You are asked to help fill the Linuxprinting.org Database with valid pieces of info concerning the PJL commands understood by your printer. Every user with a printer connected to a parallel or USB port can help to achieve a better Linux support for his printer (if not working perfectly already).
The Database has been built and accumulated by Grant Taylor, the well-known author of the Linux Printing HOWTO for quite some time. It is a key for the achievement of one (or some?) hi class Free printing system(s) for Linux. For quite a few printers the data about working PJL commands are still very incomplete. The quicker and the more precise this gap is filled the more profound and rapid the Linux support for modern printers in a Linux environment (and, in fact, amongst other Free Unix-like operating systems as well as non-Free ones) will develop in the months ahead. The database is not just of a huge advantage for CUPS -- other printing and spooling systems will also benefit a lot, like BSD-LPD, LPRng or PDQ.
On the backgrounds and workings of this database you might want to read a bit in my (so far German-only) "CUPS-FAQ". If there is comcern, I could do a translation of a more detailed explanation of this action also comprehensible for newbies. (Hello, you editors of printed magazines: isn't this a good story for you as well? The author's fee I'll donate to a free software project... ;-)
This here is just a short shot.
A Shell Script To Read The PJL Capabilities Off The Printer
Keying in the PJL info for thousands of printers off the vendor's documentation is very tiring and error-prone. Is this docu available at all? Is it complete? Is it correct? -- There's a better way to find out, with your help: ask you printer directly, what it supports... Till Kamppeter, architect and maintainer of the new Mandrake 7.2 printing system which chose CUPS to be the premium install (Till is also author of the free GUI Tool for CUPS, XPP), has presented a small shell script to help you do the job. Every Linux (and maybe, BSD) supporter can use it to ask his printer(s) about their level of PJL support. The results will go into the database which is designed to become the repository of automatic driver and printer configuration files for the major spooling systems CUPS, LPD, LPRng and PDQ.
Just copy the 6 line shell script beneath, save it with an easy to remember name of your joice and mak it executable:
#!/bin/sh echo "Writing PJL options into opts.txt" echo -en "\033%-12345X@PJL\r\n@PJL INFO VARIABLES\r\n" > /dev/lp0 sleep 1 echo "Press Ctrl+C" cat < /dev/lp0 > opts.txtI'll outline in a minute, how the script works. Before that, here's what I did: hopefully usefull for any newbie volunteers wanting to help collect the data...
What The Shell Script Needs
To be sucessful, a few preconditions must be met:
So -- reload modules if needed:
root@espprintpro:/home/kurt > modprobe parport_pc root@espprintpro:/home/kurt > modprobe printerCheck the results:
root@espprintpro:/home/kurt > lsmodDoes it show up entries like parport_pc, parport, printer, und lp ? OK, you're nearly done...
If you use an USB-connected printer the script needs a slight modification. Instead of /dev/lp0 insert /dev/usb/lp0 at two places. And of course your Kernel needs to support USB. You might need to load the USB module:
root@espprintpro:/home/kurt > modprobe usbcore
How The Shell Script Works
The script uses a PJL command to ask the printer about further PJL commands it understands and supports. If there is communication at all, the script writes every retransmission of the printer into the file opts.txt. If the script doesn't stop after the printer finished responding, just use STRG + C to abort it. Now have a look into the harvested file: you may have some readable output in there. If it is empty, there was no answer from the printer. If additionally the printer prints something, it does understand ASCII.
Before you test your next printer please re-name the file opts.txt to some name you can easily associate with your first printer; that way you avoid it to become overwritten .
root@espprintpro:/home/kurt > mv opts.txt HP_LaserJet_5L_opts.txt.Till collects all renamed and non-empty opts.txt-files:
Till asked to run the script even if an old entry in the linuxprinting datenbase says the printer in question doesn't support PJL; this info could be wrong. Also, existing entries in the database could be incomplete.
Most existing entries concerning PJL have been typed in from official vendor manuals. However, Till discovered using his script about an undocumented, but supported and welcome behaviour of the HP LaserJet 4050: this one changes its default language at the User Display through a PJL command. This even dispite the fact, that there is neither a possibility in one of the front panel menues for this nor a hint in the Manual. But his script brought it to the light and let him find out which command to use... Now watch out: You soon might have even more options at your finger tips than your colleague still enchained to a Windows box! And once there was a time, that you was suffering from jealousy when you watched him running the large office printer from his desktop using all the printers bells and whistles? Never again.
Kurt Pfeifle, author of the CUPS-FAQ
More Infos:[Long URIs are there to have them on paper (if you decided to print this page).]
Licensing of this document:
Copyright 2001 Kurt Pfeifle, author of CUPS-FAQ
0 Talkback[s] (click to add your comment)