uport lp device problems, HP LaserJet II wont work

Rick Richardson rick at pcrat.UUCP
Fri May 19 21:16:19 AEST 1989


Here is the lp printer interface that we supply with JetRoff.  It
handles serial or parallel configurations, and translates CR/LF
by default, but you turn this off with the "-otroff" option to
"lp" when you want to print troff or graphics.

-Rick

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	hplaser-par
# This archive created: Fri May 19 07:13:00 1989
export PATH; PATH=/bin:/usr/bin:$PATH
if test -f 'hplaser-par'
then
	echo shar: "will not over-write existing file 'hplaser-par'"
else
sed 's/^X//' << \SHAR_EOF > 'hplaser-par'
X# hplaser: lp model interface for HP LaserJet Series II
X#
X# command arguments are:
X#	request-id user-name title copies printer-options file1 [file2 ...]
X#	$1         $2        $3    $4     $5
X#
X# options are:
X#	-otroff		#No cr/lf mapping (for JetRoff, etc.)
X#	-oland		#Landscape orientation for unformatted text
X#	-o2on1		#Two pages on one page for unformatted text
X#	-oi		#Indent 8 characters for unformatted text
X#	-o17cpi		#17 CPI for unformatted text
X#
X# Configuration:
Xspeed=exta	#Serial interface speed (19.2)
Xspeed=		#Parallel interface leave blank
Xbanner=0	#Enable printing of banner page
Xpicture=0	#Enable printing of $HOME/.mugshot on banner page
X		#.mugshot is any PCL, typically a scanned picture of the user
X#
X#
Xnoraw="\033&k2G"
Xraw="\033&k0G"
Xif [ "$speed" != "" ]
Xthen
X	stty sane $speed ixon ixoff -ixany -parity onlcr -tabs -opost <&1
Xfi
X# character sequence to initialize printer before printing
XSET=""
X# character sequence to reset printer after printing done
XRESET="\033E"
X#
X#	First, get printer banner page out in portrait, courier
X#
Xif [ $banner = 1 ]
Xthen
X	PCOURIER=	#"\033&l66p2e7.6c66F"
X	GRAY="\033*c2400a150b30g2P"
X	TLOC="\033*p0x0Y"
X	echo "$RESET$noraw$PCOURIER$TLOC$GRAY\n\n\n\n"
X	banner "  $2"
X	echo "\n"
X	user=`grep "^$2:" /etc/passwd | line | cut -d: -f5`
X	if [ -n "$user" ]
X	then
X		echo "                User: $user\n"
X	else
X		echo "\n"
X	fi
X	echo "                Request id: $1    Printer: `basename $0`\n"
X	echo "                Options: $5\n"
X	echo "                `date`"
X	echo "\n"
X	if [ -n "$3" ]
X	then
X		banner $3
X	fi
X	if [ $picture = 1 ]
X	then
X		home=`grep "^$2:" /etc/passwd | line | cut -d: -f6`
X		if [ -f "$home/.mugshot" ]
X		then
X			echo "$raw\c"
X			echo "                \c"
X			cat $home/.mugshot
X			echo "$noraw\c"
X		fi
X	fi
X	echo "\014\c"
Xelse
X	echo "$RESET\c"
Xfi
X#
X#	Now process user options
X#
Xtrap 'echo $RESET\\c; exit' 0 2 3 15
Xcopies=$4
Xopts=$5
Xshift 5
Xfiles="$*"
Xtwo_on_one=0
Xi=1
Xifraw="$noraw"
Xfor o in $opts
Xdo
X	case $o in
X	troff)
X		SET="$SET\033E"
X		ifraw="$raw"
X		;;
X	land)
X		#	&l1O		-	landscape orientation
X		#	(s16.66H	-	primary font pitch
X		#	&l5.4		-	vert motion index 48ths/in
X		#	&l6E		-	Top margin
X		#	&l66F		-	text length
X	SET="$SET\033&l1O\033(s16.66H\033&l5.4C\033&l6E\033&a0R\033&l66F"
X		;;
X	17cpi)
X		#	(s16.66H	-	primary font pitch
X		#	&l5.4		-	vert motion index 48ths/in
X		#	&l6E		-	Top margin
X		#	&l66F		-	text length
X		SET="$SET\033(s16.66H"
X		;;
X	i)	# indent 8 characters
X		SET="$SET\033&a8L"
X		;;
X	2on1)
X	SET="$SET\033&l1O\033(s16.66H\033&l5.4C\033&l6E\033&a0R\033&l66F"
X		two_on_one=1;
X		;;
X	esac
Xdone
Xwhile [ $i -le $copies ]
Xdo
X	for file in $files
X	do
X		echo "$SET$ifraw\c"
X		if [ $two_on_one = 1 ]
X		then
X			cat "$file" | newform -i | \
X				sed "s/^/| /" | pr -2 -w175 -t
X			echo "$RESET\c"
X		else
X			cat "$file" 2>&1
X			echo "$RESET\c"
X		fi
X	done
X	i=`expr $i + 1`
Xdone
Xexit 0
SHAR_EOF
fi
exit 0
#	End of shell archive
-- 
Rick Richardson | JetRoff "di"-troff to LaserJet Postprocessor|uunet!pcrat!dry2
PC Research,Inc.| Mail: uunet!pcrat!jetroff; For anon uucp do:|for Dhrystone 2
uunet!pcrat!rick| uucp jetroff!~jetuucp/file_list ~nuucp/.    |submission forms.
jetroff Wk2200-0300,Sa,Su ACU {2400,PEP} 12013898963 "" \d\r\d ogin: jetuucp



More information about the Comp.unix.microport mailing list