Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-SPAM-Tag: Spamcop.net-.200.44.32.171.-http://spamcop.net Message-ID: <120620-2200382512845664@cantv.net> Reply-To: rodmedina AT cantv DOT net X-ORIGINATOR-IP: 200.44.79.80 From: "Rodrigo Medina" To: cygwin AT cygwin DOT com Subject: Raw lpr outputs extra page Date: Mon, 4 Aug 2003 21:28:45 -0400 MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1 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 Medina rmedina AT ivic DOT ve -- 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/