Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jul 1997 20:26:47 -0400
From:      "Harold Smorodin" <shws@pobox.com>
To:        Al Johnson <Al.Johnson@AJC.State.Net>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: HP LaserJet 6L 
Message-ID:  <199707210027.UAA19571@smtp.interlog.com>
In-Reply-To: <01BC939C.46CF4020.Al.Johnson@AJC.State.Net>

next in thread | previous in thread | raw e-mail | index | archive | help
> Hey folks,
> 
> I'm trying to migrate all my ciritical functions from Win95 to
> FreeBSD. Ya, I hear you all groaning now :)  Since I'm no expert at
> this, been a long time since I was a unix sysadmin, I need
> assistance with the filters needed for this printer.  I have
> successfully printed plain text on the HP from the directly
> connected system sort of.  An lptest > /dev/lpt0 gets me a sheet of
> paper with a single line printed on it.  Obvisouly not what it's
> supposed to generate.  Anyone with a filter or an adequate printcap
> definition for this (or just about any PCL) printer I would really
> appreciate an email copy.
> 
> In addition, is there any special setup required to get the
> appropriate conversion from a Win95 print job to the printer via
> Samba?
> 
>  -- Al
> 

The following HP filter is what I use:

================== Begin Script ================================
#!/bin/sh
# The above assumes that the Bourne Shell is available
#
# Filter for HP printers 
#
# This file MUST be created using command:  cat > hpcrlf
#
# When finished entering, use Ctrl-d to return to system prompt
# (Press/hold the Ctrl key and strike the d key)
#
# The <esc> character (Hex 1B) is entered as Alt-027:
# (Press/hold the Alt key and enter:  027 on the NUMERIC key pad)
# 
# Create this script signed on as:  root
# Script name:  hpcrlf
# Script location: /usr/spool
# Script permissions:  chmod 775 hpcrlf
# Script ownership:  chown root:wheel hpcrlf
# After installation, execute command:  rehash
#
# Once created, this script may be edited using the vi editor, 
# PROVIDED you don't delete, alter, or overwrite the <esc>
# character which displays as a ^ [ character pair in the vi 
# editor.
#
# In the lines that follow, enter <esc> as Alt-027
#
#                         Treat LF as CRLF
echo -n <esc>\&k2G
#                         Symbol Set:  (8U = HP Roman-8
echo -n <esc>\(8U
#                         Font:  12cpi 10pt Upright Medium Courier
echo -n <esc>\(s0p12.00h10.0v0s0b3T
#                         End-of-Line Wrap
echo -n <esc>\&s0C
#                         Printer data stream
cat
#                         Printer Reset (CRLF Treatment) 
echo -n <esc>\&k0G
=========================== End Script =========================

The following is my printcap script:

================== Begin Script ================================
#
# Reference:  printcap(5)
# Script name:  printcap
# Script location:  /etc
# Set ownership & permissions as required
#

lp|HP LaserJet:\
	:sh:\
	:mx#0:\
	:lp=/dev/lpt0:\
	:sd=/var/spool/lpd:\
	:lf=/var/log/lpd-errs:\
	:of=/usr/spool/hpcrlf:
=========================== End Script =========================

I use the following script to print configuration files:

================== Begin Script ================================
#!/bin/sh
# Shell script for printing text files
#
# Script name:  prfile
# Script location:  /usr/local/bin
# Script permissions:  chmod 775 prfile
# Script ownership:  chown root:wheel prfile
# After installation, execute command:  rehash
#
case $# in
	1)
		[ -r $PWD'/'$1 ]
		if [ "$?" = 0 ] 
		then
			if [ $PWD = '/' ]
			then
				cat $1 | pr -h $1 -o 9 | lpr
			else
				cat $1 | pr -h $PWD'/'$1 -o 9 | lpr
			fi
		else
			cat $1 | pr -h $1 -o 9 | lpr
		fi
		;;
	*)
		echo "$0:  Invalid argument count:  $#" >&2
		echo " " >&2
		echo "Usage:  $0 filename" >&2
		echo " " >&2
		;;
esac
=========================== End Script =========================

I use the following script to print man pages:

================== Begin Script ================================
#!/bin/sh
# Shell script for printing MAN pages
#
# Script name:  prman
# Script location:  /usr/local/bin
# Script permissions:  chmod 775 prman
# Script ownership:  chown root:wheel prman
# After installation, execute command:  rehash
#

case $# in
	1)
		man $1 | pr -h $1 -o 9 | lpr
		;;
	2)
		man $1 $2 | pr -h $2 -o 9 | lpr
		;;
	*)
		echo "$0:  Invalid argument count:  $#" >&2
		echo " " >&2
		echo "Usage:  $0 [section] name" >&2
		echo " " >&2
		;;
esac
=========================== End Script =========================

DISCLAIMER

I am not responsible in any manner for direct, indirect, special or
consequential damages, howsoever caused, arising from the use of
these scripts.

USE AT YOUR OWN RISK

By using these scripts, you agree to assume all risks and liabilities 
arising from such use.  


Harold



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