Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Foxplus on SCO Unix - print banner

Status
Not open for further replies.

mduddytel

Programmer
Mar 25, 2014
23
US
We recently added a receipt printer to our system written in Foxplus running on SCO Unix. The printer is printing a banner at the end of every print jobs, something we have not seen with any other printer. Does anyone know if changing the Unix configuration to turn off banners will impact printing through Foxplus? Thanks.
 
Don't know but you could always try it.

Turning off banners in default/lpd will only affect those printers set up after the change is made. To delete the banner on an existing printer you would edit the printer script or use the lpadmin services.

Normal banner prints at the beginning of a job. For it to print at the end would suggest that the dump section was put ahead of the banner section in the print script.





Ed Fair
Give the wrong symptoms, get the wrong solutions.
 
Perhaps it is more accurate to say that the banner is printing "between" print jobs.

The print job being sent from Foxplus does not include any specific printer instructions - just output. There is nothing in the Fox print job that specifies a banner and everything being sent from Foxplus is printing.

It looks to me like the Foxplus job finishes and then Unix prints the banner - there is a print job identifier that prints along with it.

I am very much newbie when it comes to SCO Unix admin - the printer was setup by someone else (no longer available). It certainly appears to have been setup differently from every other printer we use with SCO Unix. This is the only printer printing the banner.

I did find the default/lpd file - here is the contents of that file:
BANNERS=1
OLD_PORT_COMPATIBLE=YES
DIALUPPRINTER=YES
PRINT_SYSTEM=SYSV

I do not know what "the dump section" is.

 
I may have found the problem - actually not a problem, just configuration. I found a configuration file for the printer in the /usr/spool/lp/admins/lp/interfaces/model.orig folder, specifically set to print the banner.

Here is the contents of that file. As I said earlier I am a newbie so I'm looking for advice about how best to change the configuration so the banner does not print. Would commenting out the sequence that echos the banner to the printer (in bold face below) work?
--------------------------------------------------------------------------------
printer=`basename $0`
request=$1
name=$2
title=$3
copies=$4
options=$5
shift; shift; shift; shift; shift

# If it is necessary to change the baud rate or other stty settings for
# your serial printer add the appropriate options here:
stty 9600 ixon ixoff -ixany -ctsflow -rtsflow opost onlcr 0<&1

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

# border around the banner
x="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# the fifth field of the /etc/passwd file is assigned to the variable user
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
[ "$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"
done
copies=`expr $copies - 1`
done
}
sleep 10
stty opost 0<&1 # flush JL
exit 0
 
/etc/default/lpd is what the system uses to set up printer script files, it has nothing to do with current print job, only future printer script files.

In the printer script change all the lines from { to done to add a # at the beginning. That comments out those lines.

Since banners print before the text in an output as shown:
done :end banner
# send the file(s) to the standard out $copies times
while [ "$copies" -gt 0 ]
do
for file
do
cat "$file" 2>&1 :print text
# echo "\f\c"
done :end print job

I can't help but wonder how the banner is printing after your F+ data. One possibility is that the data is dumped to the port (doesn't need to go through a printer script) then the script is called to handle the spacing afterwards.
How is the printer connected? Parallel, Serial, or networked? You can check the physical connection or look in scoadmin> printers.


Ed Fair
Give the wrong symptoms, get the wrong solutions.
 
Ed - Thanks for pointing me to /etc/default/lpd

This file contained the statement "BANNERS=1" and we changed that to "BANNERS=0".

No more problem with the banner printing, and extra blank pages that have been printing after other print jobs (on other printers) are no longer printing.

The problem was not linked to Foxplus at all - looks like it was strictly Unix system file.

Many thanks to everyone for the help!

Margaret
 
just for clarification and my experience, there are 2 ways to setup network printers (not using CUPS)

one is to create a "local" printer printing to /dev/null then converting that printer using the HP Network Printer utility and the other is by just running rlpconf.

there are significant differences when using the HP Network printer method, you will get a file buried way down in /usr/spool/lp/admins/lp/interfaces/printerName this is a filter applied and you can edit and set compressed print and many other options in the printing stream this is due to the fact that you started off as a "local" printer with convert to a network printer

with creating via the rlpconf cmd it is a straight shot to the device and was originally used to send print output to another SCO or Unix system including other PrintServers

in the HP Network Printer method = full printer control tcp/9100
in the rlpconf method = straight output to the down-line device tcp/515 LPD (NOTE: down-line device not always a printer)




Steve Bowman
Independent Technology, Inc.
CA, USA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top