Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Esker TUN + Transparent Printing

59 views
Skip to first unread message

Topper

unread,
Oct 3, 2001, 5:14:51 AM10/3/01
to
We currently use TUN Plus v11 in our office (installed on Win 2000
PC's) to allow our support staff to dial onto our customers SCO 5.0.6
Unix servers. This is done through a standard analogue modem and
phone line.

Through this connection, we should be able to print stuff from remote
servers on printers at our office using escape codes to enable
transparent printing. These codes are:

Printer controller mode on = <ESC>[5i

Printer controller mode off = <ESC>[4i

These tested ok by running the following command:

echo "\033[5i This is a print job \033[4i"

Can the codes be put in the printer interface file? If so where for
the epson or HPlaserJet model?

Any help would be appreciated.

Bob Rasmussen

unread,
Oct 3, 2001, 11:35:05 AM10/3/01
to
On 3 Oct 2001, Topper wrote:

> ...


> Printer controller mode on = <ESC>[5i
>
> Printer controller mode off = <ESC>[4i
>
> These tested ok by running the following command:
>
> echo "\033[5i This is a print job \033[4i"
>
> Can the codes be put in the printer interface file? If so where for
> the epson or HPlaserJet model?

You're heading in a dangerous direction. It is a mistake to try to use the
despooler system to do passthrough print, for various reasons. The most
serious is that, because the despooler runs as a separate process from the
program generating the printout, and they're both writing to the same tty
device, you'll get intermixing of printer output and screen output. In other
words, it WON'T WORK reliably.

See our web site for a thorough discussion of passthrough printing:
http://www.anzio.com/support/printguide.htm

Regards,
....Bob Rasmussen, President, Rasmussen Software, Inc.

personal e-mail: r...@anzio.com
company e-mail: r...@anzio.com
voice: (US) 503-624-0360 (9:00-6:00 Pacific Time)
fax: (US) 503-624-0760
web: http://www.anzio.com

Alberto Rodriguez Rodriguez

unread,
Oct 4, 2001, 3:55:04 PM10/4/01
to
Topper wrote:


Yes.

The following is a patched dumb printer interface for transparent
printing. It works great with Epson. Not tested with HP LaserJet, but
may work.

---------- Cut here ---------------------------------------------------

:
#
@(#) local 97/07/27
#
#
local - Transparent printing
#
#
# Creating a null device:
# cd /dev
# mknod lpnull c 4 128 # Use the same major number that /dev/null
# chown lp lpnull # (4 en this example) and use 128 for the
# chgrp lp lpnull # minor number
# chmod 660 lpnull

# For ANSI terminals:
termport="/dev/tty1a" # Or tty2a, tty01a, ...
penable="\033[2h\033[5i\c" # Lock keyboard and enable transparent mode
pdisable="\033[4i\033[2l\c" # Disable transparent mode and unlock
# keyboard

# For WYSE 60 terminals:
# termport="/dev/tty1a"
# penable="\017\033d#\c"
# pdisable="\024\016\c"

lpnull="/dev/lpnull"
sttystr="ixon ixoff -ixany opost onlcr" # Modify if needed

# sleep 3 # Uncomment this line if terminal data appears in printer

exec <$termport >$termport 2>$lpnull
sttysave=`stty -g`
stty $sttystr

echo "$penable"

printer=`basename $0`
request=$1
name=$2
title=$3
copies=$4
options=$5
shift; shift; shift; shift; shift

# border around the banner
x="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

banner=yes

for i in $options; do
case $i in
b) banner=no ;;
esac
done

[ "$banner" = yes ] && {
# get the local system id
if test -r /etc/systemid; then
sysid=`sed 1q /etc/systemid`
else
sysid=`uname -n`
fi

# user = fifth field of /etc/passwd
user=`sed -n "s/^$name:.*:.*:.*:\(.*\):.*:.*$/\1/p" /etc/passwd`

# nhead gets the value of BANNERS or 1 by default
nhead=`sed -n 's/^BANNERS=//p' /etc/default/lpd`
[ "$nhead" -ge 0 -a "$nhead" -le 5 ] || nhead=1

# print the banner $nhead times
while [ "$nhead" -gt 0 ]
do
echo "$x\n"
banner "$name"
echo "$x\n"
[ "$user" ] && echo "User: $user\n"
echo "Request id: $request\n"
echo "Printer: $printer\n"
date
echo "\nMachine: $sysid\n"
[ "$title" ] && banner $title
echo "\f\c"
nhead=`expr $nhead - 1`
done
}

# send the file(s) to the standard out $copies times
while
[ "$copies" -gt 0 ]
do
for file
do
cat "$file" 2>&1
# echo "\f\c" # Uncomment if a form feed is needed
done
copies=`expr $copies - 1`
done
stty -hupcl 0<&1

# sleep 2 # Uncomment this line if printer data appears in terminal


echo "$pdisable"
stty $sttysave
exit 0

---------- Cut here ---------------------------------------------------

Hope this helps!

Greetings from Spain.
--
Alberto Rodriguez

0 new messages