lp skipping pages

Lenny Tropiano lenny at icus.islp.ny.us
Wed Feb 22 21:45:33 AEST 1989


In article <41140 at clyde.ATT.COM> wtr at moss.ATT.COM writes:
|>
|>gotta small problem with my newly installed printer on my
|>3b1.
...
|>whenever i send a text file to the printer (using either lp or
|>writing directly to /dev/lp), it will print the first page fine,
|>but then i get a form feed right after the first 67 lines.  this
|>is with or without using 'pr'.
|>

It seems like the line printer parallel device driver (/dev/lp) will send
a formfeed after each queued job is finished.  For some reason, unlike
most UNIX machines, the 3B1/7300 has to be different.   Most control
for line printer spooler formatting should be done in the:
	/usr/spool/lp/interface/<printer>	 *interface file*

This is a shell script, by default, although it can be replaced by an 
executable program.  It seems like the interfaces have 
echo "\014\c" 's imbedded in them.  This will formfeed your job, under
your control, but presumably it was taken out by yourself when you
decided you didn't want to formfeed after each job... 

Take this situation, you have special forms going to a printer designated
for forms, let's say billing statements.  You send a few alignment patterns
to line up the forms, and then shoot, and send the entire run.  Unfortunately,
if you queue your jobs to the parallel printer (/dev/lp) with "lp <file>",
it will formfeed to TOP OF FORM, usually set up as 66 line form, unless you
set your printer for special form lengths.  There are two ways around this,
one defeats the whole purpose of the line printer spooler, and that is 
cat'ing the file to the raw device.  

	ie.	cat special_file > /dev/rawlp

Or ... you can modify the printer spooler to not use the /dev/lp device,
but use the /dev/rawlp device.

$ su
Password:
# su lp						| 	What's happening? 
$ /usr/lib/lpshut				|shut the line printer spooler
$ /usr/lib/lpadmin -pEpson -v/dev/rawlp -mdumb	|set up Epson as dumb interface
$ /usr/lib/accept Epson				|device is accepting print jobs
$ enable Epson					|enable the device for printing
$ /usr/lib/lpsched				|turn on the spooler again

Now the spooler is set to send the jobs to the raw device which doesn't
change the characteristics of the output.

scheduler is running
system default destination: StarNX10
device for StarNX10: /dev/rawlp
StarNX10 accepting requests since Feb 15 18:20
printer StarNX10 is idle.  enabled since Feb 15 18:21

I've had my printer set this way for quite some time, and it seems to
have no *ill* side-effects.

There is also another way to deal with the device driver, and it is a
user program called setprint(1).  setprint(1) sends a different page length/
width to the LP line printer.   It's documented (believe it or not)!

Usage:  setprint lines cols

$ setprint 66 132		| default setting 66 lines/ 132 columns

Note you can not turn off formfeeds, but you can for special forms set the
printer to that form length/width.  Probably not useful for your problem
you mentioned above.

Hope this sheds some light on the subject,
-Lenny
-- 
Lenny Tropiano             ICUS Software Systems         [w] +1 (516) 582-5525
lenny at icus.islp.ny.us      Telex; 154232428 ICUS         [h] +1 (516) 968-8576
{talcott,decuac,boulder,hombre,pacbell,sbcs}!icus!lenny  attmail!icus!lenny
        ICUS Software Systems -- PO Box 1; Islip Terrace, NY  11752



More information about the Unix-pc.general mailing list