From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,406d5d6061e2ec0c X-Google-Attributes: gidfee84,public From: sterne@dublin.llnl.gov (Philip Sterne) Subject: Re: printcap output filters Date: 1996/01/10 Message-ID: #1/1 X-Deja-AN: 134773937 sender: sterne@dublin.llnl.gov references: <4d0ge3$lkf@chaos.dac.neu.edu> organization: Lawrence Livermore National Laboratory newsgroups: comp.unix.osf.osf1 Chris> I'd be very interested in talking to others who have done Chris> this or otherwise gotten JetDirect cards working with OSF1 3.2c Chris> lpd. I have several hundred of these printers I need to talk to Chris> from OSF. Here is the printcap entry I'm using: # HP Laserjet Network printer, raw port. lp1:\ :lf=/usr/adm/lp1err:\ :lp=:\ :mx#0:\ :rm=machine.address.gov:\ :rp=raw:\ :sd=/usr/spool/lpd1: This prints postscript and PCL. To get text as well, there are two simple options, neither of which is entirely satisfactory: 1. Define another printcap entry to point to the text queue on the JetDirect card: # HP Laserjet Network printer, text port. lp2:\ :lf=/usr/adm/lp2err:\ :lp=:\ :mx#0:\ :rm=machine.address.gov:\ :rp=text:\ :sd=/usr/spool/lpd2: This gives you two separate queues with two printcap entries for the printer, one for raw input (PCL, postscript, HPGL2), the other for ASCII text. You have to remember to use the right queue to print the appropriate sort of file. 2. Locally run a filter to convert text to postscript or PCL as a wrapper around your lpr command. You can do this with a one-liner along the lines of /usr/lbin/hplaserof < filename | lpr -Plp1 which you can make a shell script, if you are so inclined. I've called mine lprt, and stuck it in /usr/local/bin. Now you have just one printcap entry for the printer, but different commands to print raw and text files. As another poster has already noted, the if and of parameters are ignored if the rm parameter is defined in the printcap file; it is assumed that the appropriate filtering will be done at the "host" computer that has the direct connection to the printer. Unfortunately, since the remote print queue is directly on the LaserJet, the only way we can control filtering at the "host" end in this case is by firing the job at the appropriate queue. But you aren't using an rm flag in your printcap; as I understand it, you are using the filter itself to do the printing. If you can get your approach to work, it would provide a third option, with just a single command and a single printcap entry, which would be very nice. Maybe there is a way to make it work by setting some other flags differently, e.g. define lp=/dev/null so the lpd command has somewhere to dump whatever output comes from the filter (doesn't work; I tried it). If you find a way to make it work, please let us know. Phil -- --------------------------------------------------------------------- Philip Sterne | sterne@dublin.llnl.gov Lawrence Livermore National Laboratory | Phone (510) 422-2510 Livermore, CA 94550 | Fax (510) 422-7300