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!

Getting rid of form feeds / printing issues

Status
Not open for further replies.

alayaho

IS-IT--Management
Feb 21, 2002
27
ID
Hi,

Thanks for your help previously pcunix, but now I have another problem.

I need to remove the form feeds when printing. We are printing formatted text on continuous paper. Since the layout has already been set properly, form feeds ruin it. I read some articles which told me to look for places in scripts where form feeds are added, but I can't find any that make a difference.

I have checked /etc/lp/interfaces/"printername"
and /etc/lp/interfaces/model.orig/"printername"
and /etc/lp/printers/"printername"/configuration

None of these seemed to work. What are the scripts that get run when printing. Are there some I haven't covered?

I am using Unixware 7.1.1

Also, our printers are connected to HP JetDirect 3 port print servers. If the printer on port 1 is offline, the other 2 printers are unable to print. Why is this? How can I change this?

Any advice from anyone would be much appreciated.

Thanks in advance for the help
 
The offline problem is fixed simply by renaming /etc/getone to something else. See for the full details on why.

The printing flows through the areas mentioned. You are probably just not recognizing the form feed. If this is the HP, it's the script under model.orig. Depending on the script, it may do an echo "^L", an echo "/014" or even a tput ff or tput formfeed.

I don't have a UW machine to look at right here, so I don't remember if it offers a "dumb" interface script- if your output is already set with everything it needs, this is an easy script to understand and edit.

You might find the helpful for Unixware printing too. Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
I haven't used Unixware as of yet but had the same problem in SCO Open Server. We have a pretty short vanilla script that we use for Dot Matrix Printer through HP 170X Printer Server Boxes. It solves the form feed problem. I'll past the script here:

# Portions Copyright 1980-1989 Microsoft Corporation
# Portions Copyright 1983-1989 The Santa Cruz Operation, Inc
# All Rights Reserved

#ident "@(#)lp:model/dumb 1.3.1.2"
# lp interface for dumb line printer
#

copies=$4
shift; shift; shift; shift; shift
files="$*"
i=1
while [ $i -le $copies ]
do
for file in $files
do
cat "$file" 2>&1
#echo "\014\c"
done
i=`expr $i + 1`
done

exit 0
Sorry it doesn't format very pretty here. It's worth a try thought to see if it works.

Pilot1
 
Well, I may have a solution to your form feed problem.

1) Go to the print manager in scoadmin ($ scoadmin [ENTER]
2) Go to settings ==> Advanced ==> and change Banners to 0

Exit scoadmin and make sure your logged in as root

3) Edit with vi /etc/default/lpd - find BANNERS=1 and change it to 0
4) Edit /usr/spool/lp/admins/lp/interfaces/<printer name> (name of your printer)
rem out the line that says &quot;reset to default mode&quot; with a # in front of the line so it does not execute.
5) Locate the line that says banners=yes and change it to bannenrs=no
6) Locate where the entry says - echo &quot;\f\c&quot; and change it to echo &quot;\c&quot; this removes form feed at the end of each request

Hope this helps

Duane Hutton
frontier corp
dhutton27@hotmail.com
 
Duane, your advice, while it may be helpful in specific instances, is not generically useful.

First- the OP complained about form feeds, not banners.

But leaving that aside:

Only some of the interface scripts pay attention to the BANNER setting in /etc/default/lpd. If the script does use that, then that's al you'd have to do- no editing of the interface script would be necessary to suppress banners.

If you do have to edit the script, some scripts expect banners=&quot;&quot; rather than banners=&quot;n&quot;- you have to read the script to see which is correct. Some scripts invert the logic and have a nobanners=&quot;yes&quot; setting- stupid, but there it is.


Nex6, you missed that he's using hpnp printing. The controlling interface script is undere the subdirectory model.orig (as was pointed out above).

As to the form feeds that he actually wanted to know about, you also missed that it's possible for the script to use tput or ^L in addition to the \f that you mentioned. This too was mentioned previously in the thread.



.
Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Thanks for all your help guys. The form feed issue has been resolved. Just so you know, I made the following changes to /etc/lp/interfaces/model.orig/<printer_name>:

set the nofilebreak=&quot;yes&quot;

commented out the following code at the end of the script

if [ -n &quot;${FF}&quot; -a &quot;yes&quot; = &quot;${nofilebreak}&quot; ]
then
echo &quot;${CR}${FF}\c&quot;
fi

However, with respect to the getone solution for the online problem, I could not find the file. There was one in /usr/sbin, but renaming it caused printing to stop altogether, regardless of whether printer one was online.

Finally, I would have liked to try netcat, but didn't want to admit that I couldn't figure out how to unzip the files. When I type gzip -d netcat.coff.gz, I get the following error

gzip: netcat.coff.gz: not in gzip format

I transferred the file using ftp in binary transfer mode.
 
If you brought it down by web, I've seen that happen- not sure why. but the browser has already unzipped it for you and just didn't change the name (dumb browser)

Try just renaming it.. Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Any ideas about the getone issue?

I can see it affects the printing operation, but can't find where it is used in the script. I have searched both scripts a number of times.

Is there a script I can write to just return an on-line signal constantly. I only ask because this is the only remaining issue and don't want to change to netcat if I don't have to.


Thanks
 
It isn't used in the script- it's used by the hpnp binary- thst's just one of the many reasons to use netcat instead.
Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
I usualy let the application have full control of the formating. Try saving the original file that it's located in model.orig and edit this to contain only one line :cat $6

Try it like this and see what it does

Lebowsky
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top