This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Raw lpr outputs extra page


I want to report an extrange behavior of lpr.
First my instalation:
CYGWIN_95-4.0 1.3.22(0.78/3/2) 2003-03-18 09:20

Date of lpr:
244224 Jun 13 19:40 /bin/lpr

Printer: HP-DeskJet 670C, Standard instalation.

As I understand the man page of lpr, 'lpr -l -PLPT1 file_to_print' is
to put the file "file_to_print" in the printer queue without any processing.

I have found that it is not so. Apparently in some cases lpr appends
to the file.

You do a HP-file, file.prn,  using  the "print to file" option of some
(say WORDPAD).   If you send file.prn to the printer queue with the DOS

>COPY  /B file.prn PRN:

or directly to the printer with the cygwin command:

$ cp file.prn /dev/lpt1

or with

$ cat file.prn > /dev/lpt1

you get the right result.
If you send file.prn to the printer queue with

$ lpr -l -PLPT1 file.prn

you get what you expect plus an extra page with an "H" or "X" in the upper
left corner.

If you send a DOS-text file you get the same result with lpr and with copy.
The output stops in the last page because it needs a Form Feed. If you
then  send a Form Feed with

$ echo $''\f''> /dev/lpt1

in both cases the last page is finished correctly.

If you put a Form Feed at the end of a DOS-text file, no matter how do you
do it, both DOS COPY and CYGWIN cp yield the correct result. If you use
'lpr -l -PLPT1 file' the story is different. If the last byte of the file
is the FF character an extra blank page is produced, but if the file 
finishes with FF-LF or with FF-CR-LF the last page of the document is
printed properly and no extra page is produced.

I hope that this observations can be useful in order to delucidate what
is going on. 

I wonder if it were not convenient to add to lpr the option of appending
a FF to the file to be printed.
A final comment about printing text files with the line-printer mode of the
printer. In my case the printer is DOS-compatible, that is, it uses the 
IBM 850 code.  Only DOS text files can be sent directly to the printer, 
appart from the FF at the end. WINDOWS text files need additionally to
be translated from the ISO-latin1 code to the IBM850 code. UNIX text files
need the ISO to 850 translation, the LF to CR-LF conversion and the
FF at the end.

Rodrigo Medina

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]