Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Sep 1996 18:02:49 -0400
From:      "Chuck O'Donnell" <codonnell@bus.net>
To:        rhh@ct.picker.com
Cc:        kaplan@cslab.tuwien.ac.at, questions@FreeBSD.org
Subject:   Re: HP Laserjet 5L
Message-ID:  <1.5.4.16.19960903220249.347f8d54@bus.net>

next in thread | raw e-mail | index | archive | help
At 08:17 AM 9/3/96 -0400, Randall Hopper wrote:
>On Fri, 30 Aug 1996, Leon Kaplan wrote:
>> I followed the steps in the handbook but I just can't seem to
>> get this working:
>> 
>> My HP 5L is on /dev/lpt0. When I try to "cat /etc/printcap > /dev/lpt0" then
>> (appart from the missing LF -> CR+LF translation) everything gets
>> printed _very_ slowly (1/2 page per minute). If I use a simple filter script 
>> as the one below then I have the same problem. Could this be because of 
>> interrupt driven mode? Should I switch to polling? Any experiences?
>
>Sounds familiar :) Try lptcontrol -p.  Either that, or remove the other
>conflicting device on IRQ 7, if one exists (probably a sound card or a
>second parallel port).
>
>Randall Hopper
>rhh@ct.picker.com
>
>

Leon,

I don't know about the slow printing problem, but for the CR/LF problem, you
can use the attached filter `laser.c'.  It also has settings for pitch,
font, and indentation.  The printer does have a built in escape sequence
command to set the the correct CR/LF action internally, but it was easier to
do it with a filter. Let me know if you want the HP command and I'll go see
if I can dig it out.

For the filter, I have the following description in /etc/printcap:

lp|laser|LaserJet:\
	:lp=/dev/lpt0:sd=/var/spool/lpd:lf=/var/log/lpd-errs:\
	:pl=66:pw=80:sh:of=/usr/local/bin/laser:

The compiled filter program is installed as `/usr/local/bin/laser'. Note the
non-default pl setting, which was changed from 60 lines per page to 66 lines
per page using the HP Dos software on a 5P.  I'm not sure if this applies to
the 5L.

I noticed you use `cat /etc/printcap > /dev/lp0'.  I think you will need to
use the lp daemon to take advantage of the filter, i.e. `lp /etc/printcap'.

Hope you find this useful. Let me kow if you have any trouble with compilation.

Chuck O'Donnell



attachment: laser.c
=============================================================================
#include <stdio.h>

#define PITCH   15  /* font pitch (10, 12, 15, or 16.67 (condensed)) */
#define INDENT  15  /* columns to indent (0-32)*/

int main (void)
{
    int c;

    /* set font (courier) and pitch */
    printf("\033(8U\033(s0p%dh0s0b4099T", PITCH);

    /* indent */
    printf("\033&a%dL", INDENT);

    /* print the file, adding CR's */
    while ((c = getchar()) != EOF) {
	if (c == '\n')
	    putchar('\r');
	putchar(c);
    }

    /* reset the printer */
    printf("\033E");
    
    return 0;
}




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