remote printing to a network printer

I have a HP 4100N printer configured at 192.168.1.229. I am using the
following /etc/printcap file:

lpt2|LabLaser|HP 4100N LaserJet Printer in TrackStar Lab:
:sd=/usr/spool/output/lpt1:
:lf=/dev/con9:
:rm=192.168.1.229:
:rp=print:
:mx#0:
:sh

This essentially works.

At the end of the print run it prints a page with the following 4 lines:
User: ???
Host: ???
Class: ???
Job: ???
Of course the “???” are appropriately filled in.
But I am trying to supress that page with the last line in the printcap
file.

How can I supress that summary page?

I’m pretty sure you’ll find this is a function of the printer itself. For
remote printers most (almost all) printcap options are ignored, so adding
or removing the ‘sh’ will have no effect.

If you can’t control it via the printer’s own menus you may have to find
the necessary command sequence to send to the printer and add it via a
print filter. Hint: You can’t have a print filter on a remote printer. You
have to have a local ‘virtual’ printer with the print filter which then
pipes its output to the remote printer.

Rob Rutherford



On 23 Nov 2003 20:20:32 GMT, Bill Caroselli wrote:

I have a HP 4100N printer configured at 192.168.1.229. I am using the
following /etc/printcap file:

lpt2|LabLaser|HP 4100N LaserJet Printer in TrackStar Lab:
:sd=/usr/spool/output/lpt1:
:lf=/dev/con9:
:rm=192.168.1.229:
:rp=print:
:mx#0:
:sh

This essentially works.

At the end of the print run it prints a page with the following 4 lines:
User: ???
Host: ???
Class: ???
Job: ???
Of course the “???” are appropriately filled in.
But I am trying to supress that page with the last line in the printcap
file.

How can I supress that summary page?

Thanks Rob. I did figure this out.

The printer did not have a config option via it’s menus from the
control panel buttons. BUT . . .

When I connected to the printer with a web browser (Go figure!) I was
able to get to much more detailed configuration menus. There was the
option I needed.


Robert Rutherford <ruzz@nospamplease.ruzz.com> wrote:
RR > I’m pretty sure you’ll find this is a function of the printer itself. For
RR > remote printers most (almost all) printcap options are ignored, so adding
RR > or removing the ‘sh’ will have no effect.

RR > If you can’t control it via the printer’s own menus you may have to find
RR > the necessary command sequence to send to the printer and add it via a
RR > print filter. Hint: You can’t have a print filter on a remote printer. You
RR > have to have a local ‘virtual’ printer with the print filter which then
RR > pipes its output to the remote printer.

RR > Rob Rutherford



RR > On 23 Nov 2003 20:20:32 GMT, Bill Caroselli wrote:

I have a HP 4100N printer configured at 192.168.1.229. I am using the
following /etc/printcap file:

lpt2|LabLaser|HP 4100N LaserJet Printer in TrackStar Lab:
:sd=/usr/spool/output/lpt1:
:lf=/dev/con9:
:rm=192.168.1.229:
:rp=print:
:mx#0:
:sh

This essentially works.

At the end of the print run it prints a page with the following 4 lines:
User: ???
Host: ???
Class: ???
Job: ???
Of course the “???” are appropriately filled in.
But I am trying to supress that page with the last line in the printcap
file.

How can I supress that summary page?

I have lpd talking to a network printer.
I have spooler talking to lpd through lpr.
All of this is on a server node.

I have added the -g option to spooler on that node to “make the printer
a global network resource”. But nothing shows up on any other node
that wasn’t already there.

Do I need a seperate copy of spooler to run on the other nodes?

I have a print queue configured using lpd. It works. It talks to a
remove printer. It is essentially a “raw” print queue.

I want to add a second print queue that adds an output filter and then
chains to the first print queue.

How can I do this?

On 25 Nov 2003 16:06:18 GMT, Bill Caroselli wrote:

I have a print queue configured using lpd. It works. It talks to a
remove printer. It is essentially a “raw” print queue.

I want to add a second print queue that adds an output filter and then
chains to the first print queue.

How can I do this?

Add a second entry in /etc/printcap with a if= entry to define the output
filter.

Inside the print filter, just do "lpr -P "

The following shell script is our template print filter. You may find it
useful. It includes an example of how to do what you want.

#!/bin/sh

Overview: Template print filter for use with lpd/printcap.

Only tested with QNX.

This file is provided for three purposes:

- as a basic filter that performs the commonly required LF->CR/LF

conversion

- as a template for rsh printing to remote HP-UX or Xenix spoolers.

- as a template that can be expanded for more complex filtering tasks.

For this second reason there is a lot of stuff included here that is

not needed at all for the basic filter

If this filter is an output filter (of=) it will be called by lpd like

this:

print_filter -wwidth -llength <print_job >printer 2>lpd_logging

If this filter is an input filter (if=) it will be called by lpd like

this:

print_filter [-c] -wwidth -llength -iindent -nlogin \

-hhost_accounting_file\

<print_job >printer 2>lpd_logging

Otherwise (eg af=,tf=) it will be called by lpd like this:

print_filter -xwidth -ylength -nlogin -hhost_accounting_file\

<print_job >printer 2>lpd_logging

It must return

0 if there were no errors,

1 if the job should be re-printed

2 if the job should be thrown away

It will be sent SIGINT if the current job is removed using lprm.

#***********************************************************************

width=“80” # default is 80 columns
length=“66” # default is 66 lines

print_usage

print command line usage to stderr and exit

me=${0##*/}
print_usage ()
{
echo “Usage: $me [-c] -llength -wwidth -iindent -nlogin -hhaccfile”
1>&2
exit 2
}

Process command line args

if [ $# -lt 1 ] ; then
print_usage
fi

while getopts ch:i:l:n:w:x:y: opt
do
case $opt in

w) width=$OPTARG ;;
l) lenght=$OPTARG ;;
?) print_usage ;;

esac
done

OK do the filtering

Remember we want to map standard input to standard output

Case 1)

this simple case just maps LF to CR/LF

tr ‘\012’ ‘[.\015\012.]’

Case 2)

Send job to a print spooler on a remote Xenix or HP (NOT QNX!) computer.

Used as an input filter (if=) in a printcap entry that has :lp=/dev/null:

See remote_rsh_prt example in /etc/printcap and for more details.

Replace:

REMOTEHOST with a computer name, e.g., mmgr

REMOTEPRINTER with spooler name on remote machine, e.g., media

E.g., rsh mmgr lp -dmedia

#rsh REMOTEHOST lp -dREMOTEPRINTER

Case 3)

Translater LF to CR/LF and add a Form Feed at the end

then send it on to the “raw” print queue

#tr ‘\012’ ‘[.\015\012.]’ > /tmp/print_filter$$
#echo ‘\014’ >> /tmp/print_filter$$
#cat /tmp/print_filter$$ | lpr -P hp6raw
#rm /tmp/print_filter$$


exit 0