This is the mail archive of the cygwin@cygwin.com 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]

Re: Raw lpr outputs extra page


--- Rodrigo Medina <rodmedina@cantv.net> wrote:
>  Hello!
> 
> I want to report an extrange behavior of lpr.
> First my instalation:
> /proc/version:
> 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
> supposed
> 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
> something
> to the file.
> 
> You do a HP-file, file.prn,  using  the "print to file" option of some
> program
> (say WORDPAD).   If you send file.prn to the printer queue with the DOS
> command
> 
> >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,

I will try to spend a little time looking at this, but it's highly unlikely
that I'll be able to duplicate the problem because 1) I don't have the same
printer, 2) I don't have access to any machines running Win95, and 3) I don't
have access to any locally-connected printers.

I'd be interested to know if using "Printer Name" instead of lpt1 as the device
works any differently. In other words, if the name of your printer in the
Printers applet of Control Panel shows as "HP-Deskjet 670C", try using the
command

lpr -l -P "HP-Deskjet 670C" file.prn

to spool your file and see if it makes any difference. The code that allows lpr
to access devices like "lpt1" is experimental, at best, because I have no way
to test it due to item (3) above. The other items I would be interested in are
1) output from lpr when used with the -D flag (adds debugging printout) when
the device is lpt1, and 2) the actual contents of your file.prn, preferrably
archived and compressed.

--Rick

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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