Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Re: printcap output filters
  1996-01-10  5:00 Chris Johnson
  1996-01-10  5:00 ` Philip Sterne
@ 1996-01-10  5:00 ` Charles Richmond
  1996-01-22  5:00 ` Greg Merrell
  2 siblings, 0 replies; 6+ messages in thread
From: Charles Richmond @ 1996-01-10  5:00 UTC (permalink / raw)
  To: Chris Johnson

Chris Johnson wrote:
> 
>      Hi all.  Happy New Year.
> 
>      I'm trying to get an output filter to work from printcap for lpd.
> Having trouble doing so.  The net result is to get lpd to talk to HP Laser
> Jet JetDirect cards.  

...
...

> DEC also doesn't seem to be helping much with this.  They may not support
> JetDirect cards but they do support output filters in printcap.  No go yet
> though.
> 
>      So what's the trick?  What do I do in printcap to get this to work.
> Remember, it does work when I do
> 
> cat file | /usr/lbin/ln03rof | /usr/local/bin/nc a.b.c.d 9100
> 
> by hand.  All I seem to be missing is the magic to get printcap/lpd
> to believe in the printcap of entry.  Oh, and a.b.c.d is a real address on
> my network when I run this.
> 
>      I'd be very interested in talking to others who have done this or
> otherwise gotten JetDirect cards working with OSF1 3.2c lpd.  I have several
> hundred of these printers I need to talk to from OSF.
> 
>      Thanks.  Any constructive help much appeciated.
> 

In my printcap are two entries:

lp1|1:\
        :af=/usr/adm/lp1acct:\
        :if=/usr/lbin/hplaser4psof:\
        :lf=/usr/adm/lp1err:\
        :lp=:\
        :of=/usr/lbin/hplaser4psof:\
        :rm=inpon:\
        :rp=text:\
        :sd=/usr/spool/lpd1:
lp|lp2|2|hp4m:\
        :af=/usr/adm/lp2acct:\
        :fc#0177777:\
        :fs#020:\
        :if=/usr/lbin/hplaser4psof:\
        :lf=/usr/adm/lp2err:\
        :lp=:\
        :of=/usr/lbin/hplaser4psof:\
        :rm=inpon:\
        :rp=raw:\
        :sd=/usr/spool/lpd2:\
        :sh:

The first is for postscript and the second is for text. There are problems
with full page graphics overflowing the HP , that seem to be related to
a problem with lpd on DU3.2 (214). Those problems may have been fixed 
in later versions (3.2c etc) but I have been trying to decide how to replace
lpd and what to replace it with. (My DU is running the Japanese LV). A binary
conversion of the Ultrix 4.4 lpd would work for non-Asian locales.

The real bottom line for what you are trying to do is that lpd completely
ignores outputfilters for remote printers. You need to handle it with a
script replacement or with an input filter. The "of" lines in my printcap
entries are ignored completely. It is a "feature"!

Charlie

-- 
 *************************************************************************
 *  Charles Richmond 	Integrated International Systems Corporation     *
 *	  cmr@iisc.com	cmr@koibito.iisc.com  cmr@shore.net		 *
 *  UNIX Internals, I18N, L10N, X, Realtime Imagimg, and  Custom S/W	 *
 *  One Longfellow Place Suite 3309 , Boston , Ma. USA 02114-2431        *
 *  (617) 723 7695	(617) 367 3151		FAX (617) 723 6861       *
 *************************************************************************



^ permalink raw reply	[flat|nested] 6+ messages in thread

* printcap output filters
@ 1996-01-10  5:00 Chris Johnson
  1996-01-10  5:00 ` Philip Sterne
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chris Johnson @ 1996-01-10  5:00 UTC (permalink / raw)


     Hi all.  Happy New Year.

     I'm trying to get an output filter to work from printcap for lpd.  
Having trouble doing so.  The net result is to get lpd to talk to HP Laser
Jet JetDirect cards.  Neither HP nor DEC seem to support this for some
strange reason.  We have gotten this working in the past with ULTRIX but I'm
moving to OSF1 now (excuse me, that's Digital UNIX).  I'm piping the file to
the ln03r filter which produces postscript and then to netcat which copies
standard input to a net destination.  It works just fine when I do it by 
hand at the command prompt.  When I try it in the of entry in printcap
nothing happens except an error in the lpr.log file created by syslogd.
The error is this in the log

Jan  9 11:59:11 chaos lpd[479]: pid=4432 (sig=-1,err=1)

which isn't very useful.  DEC doesn't seem to be forthcoming with info 
on this.

     This printcap entry I'm tring to use is as follows

testq|lp0:\
        :lp:\
        :lf=/usr/adm/testqerr:\
        :of=/usr/lbin/ln03rof | /usr/local/bin/nc a.b.c.d 9100:\
        :sd=/usr/spool/testq:\
        :ps=LN03R:\
        :pl#66:\
        :pw#80:\
        :mc#1:\
        :mx#0:sb:

DEC also doesn't seem to be helping much with this.  They may not support 
JetDirect cards but they do support output filters in printcap.  No go yet
though.

     So what's the trick?  What do I do in printcap to get this to work.
Remember, it does work when I do

cat file | /usr/lbin/ln03rof | /usr/local/bin/nc a.b.c.d 9100

by hand.  All I seem to be missing is the magic to get printcap/lpd 
to believe in the printcap of entry.  Oh, and a.b.c.d is a real address on
my network when I run this.

     I'd be very interested in talking to others who have done this or 
otherwise gotten JetDirect cards working with OSF1 3.2c lpd.  I have several 
hundred of these printers I need to talk to from OSF.

     Thanks.  Any constructive help much appeciated.

----------------------------------------------------------------------------
Chris Johnson                            Internet: johnson@lynx.dac.neu.edu
Assistant Director, Systems              BITNET:   johnson@nuhub
Division of Academic Computing           Voice:    617.373.3300
Northeastern University, 39 RI           FAX:      617.373.8600
360 Huntington Ave.
Boston, MA., U.S.A.  02115
----------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: printcap output filters
  1996-01-10  5:00 Chris Johnson
@ 1996-01-10  5:00 ` Philip Sterne
  1996-01-12  5:00   ` Boyd Adamson
  1996-01-10  5:00 ` Charles Richmond
  1996-01-22  5:00 ` Greg Merrell
  2 siblings, 1 reply; 6+ messages in thread
From: Philip Sterne @ 1996-01-10  5:00 UTC (permalink / raw)




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



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: printcap output filters
  1996-01-10  5:00 ` Philip Sterne
@ 1996-01-12  5:00   ` Boyd Adamson
  0 siblings, 0 replies; 6+ messages in thread
From: Boyd Adamson @ 1996-01-12  5:00 UTC (permalink / raw)


sterne@dublin.llnl.gov (Philip Sterne) writes:



>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:
[snip]
>  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:
[snip]
>     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
>  Phil

The other alternative that I have managed to get going (originally for
debugging purposes) was to create a print queue to which all jobs are
submitted. This print queue has an lp=/dev/null entry. Then, attach an
output filter on the queue that can decide whether the job is PS or text
(look for %!PS-Adobe in the first line) and optionally run the 
appropriate processing. The filter then submits the job to another queue
that has the appropriate rm and rp entries. It's not really elegant but
it means that you do effectively get an of on a remote printer.

Hope this helps, 

Boyd
--
--------------------------------------------------------------------------
Boyd Adamson - boyda@otto.bf.rmit.edu.au
You can't have everything. Where would you put it all?
--------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: printcap output filters
@ 1996-01-14  5:00 Ralf Puchner
  0 siblings, 0 replies; 6+ messages in thread
From: Ralf Puchner @ 1996-01-14  5:00 UTC (permalink / raw)
  To: johnson

On 10 Jan 1996 13:54:11 GMT, Chris Johnson wrote:

1. remote filters are not supported by DECunix. (OSF/1 is the old name!)
   But there is still a work around available in the digital support
   center (remotefilter.c)

2. There is still a device driver sourcecode for the HP jetdirect 
   card available. It is spreaded by HP and is called "Jetdirect
   Card Software for SUN Systems". Call our local HP Vendor and
   ask for the software!

Regards

  Ralf



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: printcap output filters
  1996-01-10  5:00 Chris Johnson
  1996-01-10  5:00 ` Philip Sterne
  1996-01-10  5:00 ` Charles Richmond
@ 1996-01-22  5:00 ` Greg Merrell
  2 siblings, 0 replies; 6+ messages in thread
From: Greg Merrell @ 1996-01-22  5:00 UTC (permalink / raw)



Chris Johnson (johnson@neu.edu) said:

> I'm trying to get an output filter to work from printcap for lpd.  
> Having trouble doing so.


Several others replied with schemes to get it to work, but none that were 
completely happy with their solutions.

I bought a DEClaser 5100 printer and made the assumption that Digital could help
me make it work with my Dunix system. Silly me. After quite a number of traded
messages with the CSC, I stumbled upon a solution that worked for me.

Here is what my printcap file looks like:
	prez|lp0|lp|0:\
	        :lp=/dev/nic/prez:\
	        :of=/usr/lbin/ps_level2of:\
	        :sd=/usr/spool/prez:

In my case, /dev/nic/prez is a pipe created by the following startup script:

	#!/sbin/sh
	#
	# Control the remote line-printers
	
	case "$1" in
	'start')
	        if /usr/nic/nic_print /dev/nic/prez prez 10001&; then
	                echo "Prez print service started"
	        fi
	        ;;
	*)
	        echo "usage: $0 {start}"
	        ;;
	esac

Since the 5100 uses a telnet type connection through port 10001, the only 
way for me to talk to it is through this pseudo device. I noticed that in your 
case, you have a similar sort of connection mechanism, so this may work for you.

The ps_level2of is capable of recognizing both text and PS format files, so I
just have the single queue.

I got misled as did you because I could get the command line form to work but
not the printcap. The use of the lp option seemed to be the trick.

Greg
=========================My return addresses are==============================
Greg Merrell                        Internet:     greg@netuser.com
MSM Company/Netuser Communications  Voice:        +1-408-253-0970
Cupertino, CA                       Fax:          +1-408-253-0590
==============================================================================



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1996-01-22  5:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-01-14  5:00 printcap output filters Ralf Puchner
  -- strict thread matches above, loose matches on Subject: below --
1996-01-10  5:00 Chris Johnson
1996-01-10  5:00 ` Philip Sterne
1996-01-12  5:00   ` Boyd Adamson
1996-01-10  5:00 ` Charles Richmond
1996-01-22  5:00 ` Greg Merrell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox