Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Oct 1997 19:29:18 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Jacques Hugo <jacques@wired.ctech.ac.za>
Cc:        FreeBSD Questions <questions@FreeBSD.org>
Subject:   Re: HP Laser 5
Message-ID:  <19971007192918.48284@lemis.com>
In-Reply-To: <343A06D1.794BDF32@wired.ctech.ac.za>; from Jacques Hugo on Tue, Oct 07, 1997 at 11:54:25AM %2B0200
References:  <3439F22D.2781E494@wired.ctech.ac.za> <19971007185701.08046@lemis.com> <343A0255.446B9B3D@wired.ctech.ac.za> <19971007191619.55515@lemis.com> <343A06D1.794BDF32@wired.ctech.ac.za>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Oct 07, 1997 at 11:54:25AM +0200, Jacques Hugo wrote:
> Greg Lehey wrote:
>
>> Does
>>      it
>>         maybe
>>                  have
>>                          a
>>                                  staircase
>>                                          effect?
>
> Yip! That's it.

Aaaaah.  That took a lot of extraction.

> And if I pipe a txt file through it,
> you get the staircase effect plus say if I cat the
> /etc/passwd file to lpr I get
>
> root:*:0:0:Charlie &:/root:/bin/csh
> 		toor:*:0:0:Bourne-again Superuser:/root:
>
> the staircase effect and printed output isn't complete.

Sure, it's all overhanging the right margin.

This is described in the handbook section on printing.  Basically, you
need a filter which sets the control characters correctly.  Here's the
example from the handbook:

Installing the Text Filter

We are now ready to tell LPD what text filter to use to send jobs to
the printer. A text filter, also known as an input filter, is a
program that LPD runs when it has a job to print. When LPD runs the
text filter for a printer, it sets the filter's standard input to the
job to print, and its standard output to the printer device specified
with the lp capability. The filter is expected to read the job from
standard input, perform any necessary translation for the printer, and
write the results to standard output, which will get printed. For more
information on the text filter, see section Filters.

For our simple printer setup, the text filter can be a small shell
script that just executes /bin/cat to send the job to the
printer. FreeBSD comes with another filter called lpf that handles
backspacing and underlining for printers that might not deal with such
character streams well. And, of course, you can use any other filter
program you want. The filter lpf is described in detail in section
lpf: a Text Filter.

First, let uss make the shell script /usr/local/libexec/if-simple be a
simple text filter. Put the following text into that file with your
favorite text editor: <hr>

#!/bin/sh
#
# if-simple - Simple text input filter for lpd
# Installed in /usr/local/libexec/if-simple
#
# Simply copies stdin to stdout.  Ignores all filter arguments.

/bin/cat && exit 0
exit 2

<hr> Make the file executable: 

     chmod 555 /usr/local/libexec/if-simple

And then tell LPD to use it by specifying it with the if capability in
/etc/printcap. We will add it to the two printers we have so far in
the example /etc/printcap: <hr>

#
#  /etc/printcap for host rose - added text filter
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
        :sh:sd=/var/spool/lpd/rattan:\
        :lp=/dev/lpt0:\
        :if=/usr/local/libexec/if-simple:

bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
        :sh:sd=/var/spool/lpd/bamboo:\
        :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:\
        :if=/usr/local/libexec/if-simple:

<hr> 

BTW, I would very much doubt that this problem doesn't exist under
Linux.  The reasons are the same.

Greg



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971007192918.48284>