When the JetDirect module on an HP Laserjet 2200dn broke, I thought it would be straightforward to hook it up to the USB or parallel port of a linux box instead.
I'm using lpr (actually LPRng). Adding the printer was indeed easy - just
specify lp=/dev/lp0 or lp=/dev/usb/lp0 in
the /etc/printcap entry.
But when I printed a postscript job, the printer received the job but was unable to detect the end of the print job (postscript has no 'end of job', apparently). So not only would the printer sit there, light flashing, awaiting more pages (until it timed out), but worse, because it's a duplex printer, if I print an odd number of pages it would sit there waiting for the "next" page. Even worse, if I printed two jobs, the first of which with an odd number of pages, they would get combined so the first page of the second job was on the back of the last page of the first!
Since there seemed to be little info about this on the net, I thought I'd document my solution here (with thanks to Sanjoy Mahajan for his help). In the printcap entry, add a line:
:ff=\004:ff_separator=true:fq=true:
This tells lpr to send a control-d character (which the printer will interpret as 'end of job') between successive jobs, and after the last job.
The whole printcap entry looks something like this:
lp1|laserjet: :lp=/dev/usb/lp0: :sd=/var/spool/lpd/lp1: :sh: :lf=/var/spool/lpd/lp1/log: :ff=\004:ff_separator=true:fq=true: