From owner-freebsd-questions@FreeBSD.ORG Sun May 29 20:32:45 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 405C516A41C for ; Sun, 29 May 2005 20:32:42 +0000 (GMT) (envelope-from modelt20@canada.com) Received: from n120.sc0.cp.net (fh022.dia.cp.net [64.97.160.32]) by mx1.FreeBSD.org (Postfix) with ESMTP id 014E043E4C for ; Sun, 29 May 2005 19:54:21 +0000 (GMT) (envelope-from modelt20@canada.com) Received: from smtp.sc0.cp.net (64.97.131.2) by n120.sc0.cp.net (7.0.038) (authenticated as modelt20@canada.com) id 4293397B000D5FBA; Sun, 29 May 2005 19:54:03 +0000 Received: from [24.208.85.39] by mail.canada.com with HTTP; Sun, 29 May 2005 12:54:02 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 7bit MIME-Version: 1.0 To: wblock@wonkity.com From: modelt20@canada.com X-Sent-From: modelt20@canada.com Date: Sun, 29 May 2005 12:54:02 -0700 (PDT) X-Mailer: Web Mail 6.1.7-3.4_1 Message-Id: <20050529195403.3901.fh052.wm@smtp.sc0.cp.net> Cc: freebsd-questions@freebsd.org Subject: Re: Adding a FormFeed to an LPR printcap file? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2005 20:32:45 -0000 Hello: I think I found the answer. The problem is you don't want to use the printf command with a hex value, like I was trying; you want to use the printf "\f" syntax instead. See man 1 printf. The last line then becomes: echo "$first_line" && cat && printf "\f" && exit 0 and now it works just fine. You guys are great! I could have spent a lot of hours looking for this simple point! Thanks! Harold. >Hello: >Thank you for your reply. My if filter follows: >#!/bin/sh ># ># kx-p1124 - Print Ghostscript-simulated Postscript on >a Panasonic KX-P1124 ># installed in /usr/local/bin/kx-p1124 > ># > ># Read first two characters of the file ># >IFS="" read -r first_line >first_two_chars=`expr "$first_line" : '\(..\)'` > >if [ "$first_two_chars" = "%!" ]; then > # > # It is Postscript; use Ghostscript to scan-convert >and print it. > # > /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=lj \ > -sOutputFile=- - && exit 0 >else > # > # Plain text or HP/PCL, so just print it directly; >print a form feed > # at the end to eject the last page. > # > echo "$first_line" && cat && exit 0 >fi > >exit 2 > >As you can see, there is nothing special about this. >I am suspecting I need to add a printf "0x0c" between the >last && cat and the && exit 0 just before the fi. >Thanks in advance for your help. >Harold. >On Sat, 28 May 2005 18:47:41 -0600 (MDT), Warren Block wrote: > > On Fri, 27 May 2005 modelt20@canada.com wrote: > > > Could someone suggest a way to add a form feed to the > > end of a print document in LPR? I have a printer that > > doesn't eject the last page when the print job is > > finished; and I can't seem to find this in the manual. > > > > My guess is I need to add it to my printer filter, but > > its not clear to me what I need to add. > > What printer filter do you have now? > > -Warren Block * Rapid City, South Dakota USA