To: jmason@iona.ie
From: but@unibw-hamburg.de (Lothar Butsch)
Subject: Re: Z-option --- example
Date: Fri, 10 Feb 1995 08:30:21 +0100

Hi Justin,
  we use plp's Z-option to select different output modes
for a HP Laserjet 2000 printer. Our bp script, based on
the (numerical) value of the Z-option, selects a string of
HPPCL commands to print after the banner page is done and
so changes the printer to the desired mode.

  I edited both the script and the list of commands to delete
unimportant parts, comment the importend ones, and to get rid
of ugly \033 chars. I think it will still work.

  Hope it's useful
    Lothar

--- snip ---  --- snip ---  --- snip ---  --- snip ---  --- snip ---

#!/bin/sh
#
# script to print the banner page
#

# ... [ deleted most initialisations ]

ESC=`echo "\033"`			# we really like System V
Z=''

while [ $# -gt 0 ] ; do
  case $1 in
    -Z* ) Z=`expr $1 : "..\(.*\)"` ;;
   
    # ... [ deleted more parameter processing ]
  esac
  shift
done

# ... [ deleted output of banner page ]

case "$Z" in
  [1-9]|1[0-9] ) ;;			# good values 1-19 ( 1-44 in reality )
  * ) Z=5 ;;				# that's the default
esac

PCLCMDFILE=---------------------------- # see below --------------------
PCLCMD=`sed -n -e "/^$Z /s/<ESC>/$ESC/g" -e "/^$Z /s/^$Z //p" $PCLCMDFILE`
echo "$PCLCMD\c"			# we really like System V

exit 0

--- snip ---  --- snip ---  --- snip ---  --- snip ---  --- snip ---

#
# HPPCL commands to select output modes for HP 2000 printer
#
#  options's number
#  |
#  |  s=single sided, d=double sided
#  |  |
#  |  | p=portrait, l=landscape
#  |  | |
#  |  | | g=german characterset, a=american characterset
#  |  | | |
#  |  | | |  lines per page
#  |  | | |  |
#  |  | | |  | f=fixed spacing, p=proportional spacing
#  |  | | |  | |
#  |  | | |  | |   characters per line (min if proportional spacing)
#  |  | | |  | |   |
#  |  | | |  | |   | l=left (upper) margin
#  |  | | |  | |   | | 
#  |  | | |  | |   | |  characters per inch
#  |  | | |  | |   | |  |
#  |  | | |  | |   | |  | lines per inch
#  |  | | |  | |   | |  | |
#  1  s p g 66 f  78   10 6
#  2  s p g 66 f  63 l 10 6
#  3  d p g 66 f  78   10 6
#  4  d p g 66 f  63   10 6
#  5  s p a 66 f  78   10 6
#  6  s p a 66 f  63 l 10 6
#  7  d p a 66 f  78   10 6
#  8  d p a 66 f  63 l 10 6
#  9  s l a 45 f 113   10 6
# 10  s l a 41 f 113 l 10 6
# 11  d l a 45 f 113   10 6
# 12  d l a 39 f 113 l 10 6
# 13  d p g 66 f  80   12 6
# 14  s p g 66 f  80   12 6
# 15 ----- sorry got no documentation, we use it to print manual pages
# 16  d p a 66 f  80 l 12 6
# 17  d p a 85 f  80 l 12 8 
# 18  d p g 85 f 100 l 16 8
# 19  s p g 66 f  78   10 6 italic
# ... and so on ...
#
1 <ESC>&l0s0O<ESC>(0G
2 <ESC>&l0s0O<ESC>(0G<ESC>&a6l68M
3 <ESC>&l1s0O<ESC>(0G
4 <ESC>&l26a0o1S<ESC>&a6l68M<ESC>(0G
5 <ESC>&l0s0O
6 <ESC>&l0s0O<ESC>&a6l68M
7 <ESC>&l1s0O
8 <ESC>&l26a0o1S<ESC>&a6l68M
9 <ESC>&l0s1O
11 <ESC>&l1s1O
12 <ESC>&l26a1o6e41f1S
13 <ESC>&a1G<ESC>(1G<ESC>(s3t12h0p10V<ESC>&l0o420u1S<ESC>&a7L
14 <ESC>&a1G<ESC>(1G<ESC>(s3t12h0p10V<ESC>&l0o0S<ESC>&a13L
15 <ESC>&l26a0o1S<ESC>&a7l68M<ESC>(s0p12h10v0s0b3T
16 <ESC>(s3t12h0p10V<ESC>&l0o6d1S<ESC>&l420U<ESC>&a7L
17 <ESC>(s3t12h0p10V<ESC>&l0o8d1S<ESC>&l420U<ESC>&a7L
19 <ESC>&l0s0O<ESC>(0G<ESC>(s1S

# ... [ deleted some more entries ]
