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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Form Feed for LPD ( not HP ) printer.

Status
Not open for further replies.

dan4

MIS
Aug 21, 2002
3
US
Hello, I have looked through numerous articles and have not found what I need, or, if it can be accomplished. I am running a SCO 5.0.5 box with RLP and a printer called laguna1 configured in the printcap file. It prints fine, however, I need to add a form feed to the end of the print jobs. I cannot find an option in printcap, /etc/default/lpd etc. And since there is no script associated with this method how do I do this? I have looked at the 'virtual' info described here but that would be pre-print wouldn't it?
Thank you very much for any help,

Dan Andrews
 
I am not sure how to do this myself for remote printers because all of my printers use interface files, however one possible solution which will definitely work is to create a dummy local printer (post again if you need help doing this) who's interface file appends a form feed to the end of each print file and then prints that altered file to the remote printer. Below is an example of what the interface file would look like (Disclaimer: You might have to twiek the script since I didn't spend a lot of time on it):

-----------------------------------------------------------
#!/bin/sh
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" -d printername $tempf
rm $tempf
copy=`expr $copy - 1`
done
done
 
Thank You for your reply. Yes, if you could walk me through setting up a dummy printer I would appreciate it. I am assuming it would use a /dev/null device?

Thanks again,
Dan
 
First, you want to save the interface script above into your "/user/spool/lp/model" directory. Give it a recognizable name such as "remote_ff" and give it the same permissions and ownerships as the other files in that directory (i.e. chmod 550, chgrp lp, chown bin)

Next, go into scoadmin, Printers, Printer Manager. Choose Printer, Add Local. Give the printer a Name and Description of your choice (remember you cannot re-use an existing name). For the Model choose the model name you created above (i.e. "remote_ff"), and for Device you can use "/dev/null". Close out of scoadmin when you are done.

Finally, edit the interface file for the new printer you just created (i.e. the file in "/usr/spool/lp/admins/lp/interfaces" with the same name as the printer). Change "printername" on the lp line of the interface file (5 lines up from the bottom) to the name of the remote printer, and save the file.

Assuming there aren't any bugs in the interface file, you should now be able to print to the new printer, and the jobs will come out on the remote printer with a form feed at the end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top