Operating System - HP-UX
1833860 Members
2222 Online
110063 Solutions
New Discussion

dot matrix printer formfeed

 
SOLVED
Go to solution
Cheng Ngan
New Member

dot matrix printer formfeed

Hi,

I've set up our dot matrix printer with HP Jetadmin using a 'dumbplot printer with CR' and everything prints out fine. The problem we have is that we need to send a form feed to the printer once the job has been completed.

I've contacted HP support and they've pointed me in the right direction. They said to modify the /var/spool/lp/interface/model.orig/printername file.

I've attached the printer file. Any help with modifying this file to add the formfeed to the end of the print job would be appreciated.

Thanks,
Cheng Ngan
6 REPLIES 6
Julio Yamawaki
Esteemed Contributor

Re: dot matrix printer formfeed

Cheng,

try this:

while [ $i -le $copies ]
do
for file in $files
do
cat "$file" | sed 's/$/\
/' 2>&1
done
i=`expr $i + 1`
done
echo "\014"
Cheng Ngan
New Member

Re: dot matrix printer formfeed

Thanks Julio.

I tried this but it only sent an extra line feed at the end of the job and not a form feed.
Any ideas on what code I should add to send a form feed (or a Control-L)?

Cheng
Julio Yamawaki
Esteemed Contributor
Solution

Re: dot matrix printer formfeed

Cheng,

try changing \014 by \014\c.
If this won't work, try changing to \n
A. Clay Stephenson
Acclaimed Contributor

Re: dot matrix printer formfeed

The echo "\014" sends a FF plus a LF (implicit); add a \c to not echo the LF.
echo "\014\c" but even better is:
echo "\f\c"; man echo for details.

This is what I would do:

TDIR=${TMPDIR:-/var/tmp}
T2=${TDIR}/P${$}_2.cmd
echo "\f\c" > ${T2}

...
...

for file in ${files}
do
cat "${file}" ${T2} 2>&1
done

....
....
rm -f ${T2}

Note that you could also create a "T1" file to do printer initialization and then
cat ${T1} "${file}" ${T2} 2>&1

to send both an initialization sequence and a termination sequence to the printer.


If it ain't broke, I can fix that.
Leif Halvarsson_2
Honored Contributor

Re: dot matrix printer formfeed

Hi,
The dumbplot script is intended for pen-plotters. Try the dumb model script instead, it sends by default a formfed after each file.
Cheng Ngan
New Member

Re: dot matrix printer formfeed

Got it working with the \014\c. option.
Thanks everyone.