[cups.general] Adding EOP to raw or lpoptions?

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Thu Dec 21 15:56:46 PST 2006


On Dec 21, 2006, at 18:34 , Ty Unes wrote:

> With "raw=true" added, the printer simply stops wherever the last
> character in the print job is and doesn't eject the page. One has to
> manually go to the printer and force-feed the paper to the tear break,
> re-park the paper, and then select 'online' again for the next job.  
> For
> clarity, if I send the printer a 5-page (1 file) job, it prints
> everything fine, respecting page breaks and even numbering pages
> correctly. But if I send 2 5-page jobs to the printer, the first 5  
> pages
> come out fine but then the second job starts printing _exactly_ at the
> next line in page 5. It's like it should be getting an EOP (end of  
> page)
> before starting the second job but it doesn't and starts printing  
> right
> in the middle of the last page of job 1. I hope this makes sense.
>
> Either case, neither using the driver or printing raw will work  
> although
> the raw option seems to be the closest. What can I do?

Use a System V-style interface script instead of a PPD file.   
Something along the lines of (untested!):

#! /bin/bash
PATH=/bin:/usr/bin:/usr/sbin:/sbin export PATH # paranoia
job="$1"
user="$2"
title="$3"
copies="$4" # the only thing we actually use
options="$5"
shift; shift; shift; shift; shift
f=""
if [ $# = 0 ]; then
     # save stdin to a temp file so we can print it properly
     f="`mktemp /tmp/pjbXXXXXXXX`" || exit 1
     cat >"$f"
     set -- "$f" # so now it's a script argument
fi
# if you need to printf(1) escape sequences to set draft mode, etc.,  
do so here
: ${copies:=1}
for pf in "$@"; do # for each file argument
     while [ $copies -gt 0 ]; do # for each requested copy, if people  
print with "lp -nCOPIES ..."
	cat "$pf"
	printf "\f"
	let copies--
     done
done
if ! [ "x$f" = x ]; then
     # clean up our temporary file from above
     rm "$f"
fi
exit 0

You specify this the same way you do a standard PPD file to lpadmin;  
I don't know how that works with the web interface, though.

-- 
brandon s. allbery    [linux,solaris,freebsd,perl]     allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH







More information about the cups mailing list