From owner-freebsd-questions Mon Nov 13 17: 3: 2 2000 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id 4D0E037B657 for ; Mon, 13 Nov 2000 17:02:59 -0800 (PST) Received: (qmail 80160 invoked by uid 100); 14 Nov 2000 01:02:58 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14864.36674.387751.668888@guru.mired.org> Date: Mon, 13 Nov 2000 19:02:58 -0600 (CST) To: "Thomas L." Cc: questions@freebsd.org Subject: Re: Count page in lpr output In-Reply-To: <40585539@toto.iv> X-Mailer: VM 6.75 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Thomas L. types: > Hi! > It is possible to get the number of page of a print file for lpr from > the print queue before the print file being printed out? I am working on a > project where I have to capture the print out submitted through lpr, count > the number of page of the print job, show it to the end user on another > workstation, only then print the submitted print job when the user press ok. Well, page counting in lpd is normally done via the accounting filter (if in printcap), but that's if you want to *log* the page count. It's expected to finish in a timely manner, so having it wait for a human user may screw things up. If you want the user who *submitted* the job to ok it being printed, you should just put a wrapper around the lp/lpr commands. If you want another human being to approve the job being printed, the input filter might be just the ticket. Or maybe you want to use the output filter (of) instead. Final note: counting pages can be *hard*.