A fix for HP AppleTalk printers hanging at end of job
Nov 25, '02 09:29:03AM • Contributed by: Anonymous
Nov 25, '02 09:29:03AM • Contributed by: Anonymous
If you have tried to print to an Appletalk HP Deskjet or Deskwriter using CUPS in 10.2, you have likely experienced the problem where it hangs at the end of the print job. This is caused by a slight difference in how the PAP protocol is utilitized in those printers. I've dealt with this problem before in Unix using the Columbia Appletalk Package.
The solution with CUPS and Jaguar is to use a different backend, other than pap, which can deal with the slight variation in how the end of job is handled.
Fortunately, Apple has provided us with a replacement for pap to fix this problem! The replacement is atprint. A script is necessary to make this compatible with CUPS. The script is attached below. This is based on the script for CAP. You can find the original CAP script in the CUPS documentation.
[Editor's note: I don't have an HP printer, so I can't test this one...]
Instructions:
Here is the atprint script:
The solution with CUPS and Jaguar is to use a different backend, other than pap, which can deal with the slight variation in how the end of job is handled.
Fortunately, Apple has provided us with a replacement for pap to fix this problem! The replacement is atprint. A script is necessary to make this compatible with CUPS. The script is attached below. This is based on the script for CAP. You can find the original CAP script in the CUPS documentation.
[Editor's note: I don't have an HP printer, so I can't test this one...]
Instructions:
- Copy the script to /usr -> libexec -> cups -> backend -> atprint
- Set the ownership and permissions on the script to the same as the other scripts in that directory.
- Restart the Mac.
- At the command line, use atlookup to get the AppleTalk name of your printer.
- Open the Print Center, hold down the option key, click "add" to get to the advanced options.
- Select "Appletalk printer via atprint" (If that option doesn't appear, start over. Either you missed a step, or I've omitted something here...)
- Enter your device URI as atprint://network/printername/printertype
- Select the gimp-print Printer Model appropriate for your printer.
Here is the atprint script:
#!/bin/sh[Editor's note: It's entirely possible that the above script is missing some backslashes. However, as the contributor was anonymous and did not provide an email address, I cannot verify that fact with the conributor prior to publication. If you see that the code is, in fact, missing some backslashes, please post a comment or drop me an email.]
#
# Usage: atprint job user title copies options [filename]
#
# Extract the Appletalk path name for this printer.
# upon a device URI of "atprint://zone/printername/printertype"...
ATPRINTER=`echo $DEVICE_URI | awk -F/ '{print $4 ":" $5 "@" $3}'`
# No arguments means show available devices...
if test $# = 0; then
echo "network atprint "Unknown" "Mac OS Printer via atprint""
atlookup |
sed -e "s/...........//" |
awk -F: '{print "network atprint://*/" $1 "/" $2 " "Unknown" " $1}'
exit 0
fi
# Collect arguments...
user=$2
copies=$4
if test $# = 5; then
# Get print file from stdin; copies have already been handled...
file=/var/tmp/$$.prn
copies=1
cat > $file
else
# Print file is on command-line...
file=$6
fi
# Send the file to the printer, once for each copy.
while [ $copies -gt 0 ]; do
atprint "$ATPRINTER"
copies=`expr $copies - 1`
done
# Send a form feed.
# printf "f" | atprint Linus:DeskWriter
# Remove any temporary files...
if test $# = 5; then
/bin/rm -f $file
fi
echo $ATPRINTER >> /var/tmp/$$.atprint
/bin/rm -f /var/tmp/$$.atprint
exit 0
•
[5,144 views]
