Discussion Locked

add ff after printing document

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a print server device. It connects my network to my parallel printer via tcp/ip. Everything is OK except that when printing in UXIX SCO 5 the last page of each document is not ejected. The printing on Windows is fine.

How do I implent a print filter?
How do I place the command to insert a form feed after the document was printed?

7 replies

by opatzg9

I know I don't have the answer you're looking for but the ascii character 012 is what ejects the page. You could either batch it in a copy to the printer or write a program to send ti to the printer. In my Sage editor I can type and add the character to a text file by holding down the ALT key while typing 012 and Then I release the ALT key and I have a formfeed character, hit enter to finish the line as you would a DOS command and write the batch file to
copy ff.txt lpt1
where ff.txt contains the circle with the + sign under it. Hope this helps til you get the answer you need.

by ann777

Does the command "cat" work to print the entire document... including the last page? If yes, then probably the lines per page are not properly set.

Backup the file you have in the below path:
/var/spool/lp/admins/lp/interfaces/"printername"

Then try editinf to the below....

NB: The line with "trchan" may or may not be needed. It is here just for an example of what you can do with this file if you need to.

To use with a network printer using "rcmd" then just "envolve" everything in "{" "}" and
pipe "|" to rcmd servername printername

When dealing with a serial port, just change the "stty" line to whatever is required. You shouldn't need it because you are using a parallel port (Do you print to a device or a named pipe?)

This file does NOT do a FF as this should handled by the application.

---
# stty 9600 tab3 0<&1 2>/dev/null 1>&2
copies=$4
shift; shift; shift; shift; shift
files="$*"
i=1
while [ $i -le $copies ]
do
for file in $files
do
#trchan /usr/lib/mapchan/lp00.por < "$file" 2>&1
cat "$file" 2>&1
done
i=`expr $i + 1`
done
---

Look at the file currently in the path and adapt the above to your needs.

by progresso2002

My printer does not accept filters I had to make a dummy local printer that prints on the remote printer. This is the procedure adopted.

Remote printer rprinter prints correctly in windows
Remote printer rprinter prints correctly sco unix exceptit does not eject last page of print job.
Local printer lprinter with print filter lfilter:

#!/bin/sh
# /usr/spool/lp/admins/lp/interfaces/lprinter
# /usr/spool/lp/model/lfilter
request=$1
name=$2
title=\'$3\'
copies=$4
options=$5
shift;shift;shift;shift;shift
files=$*
ffeed="\014"
tempf="/tmp/pf$$"

for file in $files
do
copy=$copies
while [ $copy -ge 1 ]
do
cat "$file">$tempf
echo $ffeed\c>>$tempf
lp -o "$options" -drprinter $tempf
rm $tempf
copy='expr $copy - 1'
done
done

I think there is something wrong with:
copy='expr $copy - 1'
because if I use it as is it will not print at all and if I chage it to:
copy='expr $copy-1'
it prints infinite nuber of copies of the document (fortunately with aform feed appended at the end).
I think this is a syntax error.

This discussion is closed to new replies.