Letter Landscape Report: Increasing Font Size

Our town uses a general ledger application, which includes payroll. For a year, we have been trying to move away from the old “greenbar” line printers for printing everything in town. Our payroll department was the last holdout, and still use the greenbar printer for payroll proofs. These are the final check of a payroll run before it is transmitted to the bank.

The payroll department had a good point.  The line printer output was larger, and the paper size allowed the payroll staff to make notes. Letter size paper printed landscape does not allow note taking as easily, and it is harder to read.

A lot of printing with our vendor involves invoking a pre-printing script using the file to be printed as a parameter. This script does all kinds of funky things, most of which are sending special escape characters to the printer to do things like change pitch, characters per inch (cpi), select a tray, and even say the paper is letter, legal, or something else.

Here is an example script marked up to print on legal paper. Some interesting escape sequences start around line 86. The default escape sequences were commented out, and changes added right after.

#!/bin/sh
#------------------------------------------------------------
#             Form Generator created land interface
#

#
# This script will print multiple copies.
# To use from the command line, enter pay_proof_ls -nX file_name
# where X is the number of copies and flie_name is the name of the file
# to be printed.
#

#
# Formixer script version 2.5 Linux ready
#
if [ Linux = "Linux" ]
then
 alias echo="echo -e"
fi

#
# This script will queue print jobs in a directory below /usr/tmp
# named by the script name.

# For example:
# Your script name is pay_proof_ls. The directory where pay_proof_ls's print jobs
# will be queued is /usr/tmp/pay_proof_ls
#

# Set up the required variables.

PRINTDIR=/usr/tmp
PRINTER=pay_proof
SCR_NM=_ls
SCR_NM_1=_ls

# Determine if the temp directory exists, if not create it

if [ -d ${PRINTDIR} ]
 then
 continue
 else
 mkdir -p ${PRINTDIR}
 chmod 777 ${PRINTDIR}
fi

if [ -d ${PRINTDIR}/${PRINTER}${SCR_NM_1} ]
 then
 continue
 else
 mkdir -p ${PRINTDIR}/${PRINTER}${SCR_NM_1}
 chmod -R 777 ${PRINTDIR}/${PRINTER}${SCR_NM_1}
fi

#
# Get no. of copies requested & save the print job
#

if [ -f "$1" ]
 then
 copies=1
 cat $1 > $PRINTDIR/prjob_$$
 else
 if [ "$#" = 1 -o "$#" = 2 ]
 then
 echo $1 > /usr/tmp/${LOGNAME}_$$
 X=`cut -c3- /usr/tmp/${LOGNAME}_$$`
 rm /usr/tmp/${LOGNAME}_$$
 copies=$X
 cat $2 > $PRINTDIR/prjob_$$
 else
 copies=1
 cat $1 > $PRINTDIR/prjob_$$
 fi
fi

#
# End of count and copy section
#

#
# Build the file to be printed starting with the printer control codes
#

# Reset printer to default state if PS capable
#echo "\033%-12345X@PJL enter language=pclc" > ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Reset printer - pcl reset code
echo "\033Ec" > ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set line termination mode
echo "\033&k2Gc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set paper size to letter
#echo "\033&l2Ac" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set paper size to legal
echo "\033&l3Ac" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set Paper Source (Tray)
#   tray 1 (front fold out tray. Set to 4
#   tray 2 top most pullout tray. Set to 1
#   tray 3 second pullout tray. Set to 5
#   delete the first # to unremark the line and replace the # between
#   the small L and the H with an apropriate set value from above
#echo "\033&l#Hc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

echo "\033&l5Hc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set left offset registration
#echo "\033&l80Uc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set landscape mode
echo "\033&l1Oc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set symbol set
echo "\033(8Uc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set fixed spacing
echo "\033(s0Pc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set point size
echo "\033(s12.00Vc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set style to upright solid
echo "\033(s0Sc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set stroke weight to medium
echo "\033(s0Bc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set typeface
echo "\033(s3Tc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set pitch condensed landscape mode
#echo "\033(s13.0Hc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set pitch a little larger than condensed landscape mode.
echo "\033(s10.50Hc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set VMI landscape mode
echo "\033&l5.45Cc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# LPI not used - VMI is set
#echo "\033&l8Dc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Top margin not set
#echo "\033&l3Ec" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set Left Margin to 3
echo "\033&a3Lc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Set Printing to double sided long edge binding
echo "\033&l1Sc" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

#
# End of laser code section
#

chmod 777 ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

#
# Put the file to be printed in the tmp file after reformating
#

# No modifications
# Pass the file to the printer unmodified

cat $PRINTDIR/prjob_$$ >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

# Reset the printer at end of job
#echo "\033E" >> ${PRINTDIR}/${PRINTER}${SCR_NM_1}/$$

#
# Remove the print job file
#
rm $PRINTDIR/prjob_$$

# Print the file $copies number of times
while [ "$copies" -gt 0 ]
 do

lp -d${PRINTER} -c -s ${PRINTDIR}/${PRINTER}${SCR_NM}/$$

# Give lp a chance
#sleep 3

# Clean up
if [ $copies = 1 ]
 then
 rm ${PRINTDIR}/${PRINTER}${SCR_NM}/*
fi

 copies=`expr $copies - 1`
done
exit 0

#
# End of interface file
#
Advertisements

Leave a comment

Filed under printing

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s