smbprinting --> HP

Edan Idzerda edan at mtu.edu
Fri Jul 17 18:03:27 GMT 1998


Brett Worth <brett at select.com.au> said:
> 2. Make the HP handle the eol it's self
> 
> Number 2 is the best option.  If you have a choice it's better to not tamper
> with the data in the queue.  In that way you dont lose the ability to send
> binary PCL to the same queue (unix2dos would corrupt binary data).

This is a script I use as an input filter for LPRng.  It demonstrates
the concept :)  It's worked well for me with crusty old LaserJet II's 
and III's.

Cheerio.

- edan


#!/bin/sh
#
# This is a simple filter for printing text to an HP printer attached
# to a Windows 95/NT server.  Written for Solaris 2; use echo -n instead
# of printf for SunOS 4 and other BSDish systems.
#
# edan at mtu.edu 	6-March-97

SERVER=$1
PRINTER=$2
SMBCLIENT=/usr/arch/samba/bin/smbclient

CRLFSTR="\033&k2G"
FFEED="\014"
WRAPON="\033&s0C"		# turn on line wrapping

SHARE='\\'${SERVER}
SHARE=${SHARE}'\'$PRINTER

(printf $CRLFSTR; cat - ; printf $FFEED ) | 
#	tee /tmp/$0.$$ |
	$SMBCLIENT ${SHARE} -P -N -c "print -"






More information about the samba mailing list