From owner-freebsd-questions Tue Aug 20 07:36:22 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA03104 for questions-outgoing; Tue, 20 Aug 1996 07:36:22 -0700 (PDT) Received: from eins.siemens.at (eins.siemens.at [193.81.246.11]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id HAA03074 for ; Tue, 20 Aug 1996 07:36:02 -0700 (PDT) Received: from sol1.gud.siemens.co.at (root@firix [10.1.143.100]) by eins.siemens.at (8.7.4/8.7.3) with SMTP id QAA08687 for ; Tue, 20 Aug 1996 16:35:23 +0200 (MET DST) Received: from ws2301.gud.siemens.co.at by sol1.gud.siemens.co.at with smtp (Smail3.1.28.1 #7 for ) id m0usrtp-00025EC; Tue, 20 Aug 96 16:35 MET DST Received: by ws2301.gud.siemens.co.at (1.37.109.16/1.37) id AA098111513; Tue, 20 Aug 1996 16:31:53 +0200 From: "Hr.Ladavac" Message-Id: <199608201431.AA098111513@ws2301.gud.siemens.co.at> Subject: Re: Printer accounting woes To: tinguely@plains.nodak.edu (Mark Tinguely) Date: Tue, 20 Aug 1996 16:31:53 +0200 (MESZ) Cc: andersoj@enc.edu, freebsd-questions@freebsd.org In-Reply-To: <199608201341.IAA07772@plains.nodak.edu> from "Mark Tinguely" at Aug 20, 96 08:41:30 am X-Mailer: ELM [version 2.4 PL24 ME8a] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk E-mail message from Mark Tinguely contained: > > If you do not have serial line to every printer, you still can get a pretty > good *text* page count by counting carriage returns and form feeds in the > output filter. This is pretty useless for postscript files, but then a person > could work a filter program using gs to count the pauses between gs processing > the postscript pages. For PostScript you could hack a gs driver which doesn't emit anything in normal case, and emits only something easily parsable (e.g. newline) whenever it has to flush a page. Then count the characters :) Such a driver should be farely trivial (on order of 20 C lines or so) and pretty resource-wasteful only to count pages, but absolutely reliable :) Or, you can hack the existing drivers so that they *always* print out the page flush message to stderr, and then account for them. Same trivial change. /Marino > > --mark. >