From owner-freebsd-questions@FreeBSD.ORG Thu Aug 4 00:35:41 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADED3106564A for ; Thu, 4 Aug 2011 00:35:41 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 72D158FC08 for ; Thu, 4 Aug 2011 00:35:39 +0000 (UTC) Received: from r55.edvax.de (port-92-195-103-124.dynamic.qsc.de [92.195.103.124]) by mx02.qsc.de (Postfix) with ESMTP id DC8F31E23B; Thu, 4 Aug 2011 02:35:37 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id p740ZaS6001547; Thu, 4 Aug 2011 02:35:37 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Thu, 4 Aug 2011 02:35:36 +0200 From: Polytropon To: pldrouin@pldrouin.net Message-Id: <20110804023536.ef140d49.freebsd@edvax.de> In-Reply-To: <20110803181852.GA1079@tiny> References: <201108031808.p73I818v045622@mail.r-bonomi.com> <20110803181852.GA1079@tiny> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: printing to Kyocera FS-1030D X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2011 00:35:41 -0000 On Wed, 3 Aug 2011 20:18:53 +0200, Matthias Apitz wrote: > So, what? If you can only print PCL, just raster the Postscript file > with ghostscript to PCL (using CUPS, this also can be done on the fly); Why the emphasize of CUPS? Even printer filter collections like apsfilter are "too fat" for that job. If I want to get a nail into the wall, I don't hammer it with the tool box. :-) In fact, apsfilter just uses gs with some parameters to turn PS - the _default_ printing output format - into PCL. You can install the ghostscript port (gs) and then add a very simple gs filter. It can be activated in /etc/printcap, pointing to that filter script. Here's an example of what such a filter can do (in my case: for a HP Laserjet 4000 duplex in PCL mode for two-sided priting): gs -q -dBATCH -dFIXEDMEDIA -dPARANOIDSAFER -dQUIET \ -dNOPAUSE -sDEVICE=ijs -sIjsServer=hpijs \ -sDeviceManufacturer="HEWLETT-PACKARD" \ -sDeviceModel="HP LaserJet" -dDuplex=true \ -dIjsUseOutputFD -sPAPERSIZE=a4 -r600 The corresponding /etc/printcap entry is this: Laserjet|ljet4d;r=600x600;q=high;c=full;p=a4;m=auto:\ :lp=/dev/lpt0:\ :if=/usr/local/etc/apsfilter/basedir/bin/apsfilter:\ :sd=/var/spool/lpd/Laserjet:\ :lf=/var/spool/lpd/Laserjet/log:\ :af=/var/spool/lpd/Laserjet/acct:\ :mx#0:\ :sh: (And: Yes, it's a parallel attached printer in fact.) You can easily deduct what the certain parameters do. In fact, apsfilter doesn't do much more, although it has a "pretty printing pre-filter" that allows you tricks like % lpr somepicture.png or even % lpr foo/bar/bla.c with "syntax highlighting" in the output, if you need. For printing from within X, _any_ program, be it OpenOffice or an image processing tool, accessing the proper printer queue is fully sufficient. Keep in mind that _some_ programs require you to check printer settings (like Gimp for example) for format and resolution. > > > > # cat |lpr -Plp > > To the OP: You won the todays "Useless Use of Cat Award" :-) > The same would do: > > lpr -Plp < ps-file > or > lpr -Plp ps-file > > :-) Just in case "lp" is still your default printer queue name (no $PRINTER set to override), -Plp can also be omitted. Useless use of -Plp, because that's the default. :-) When you _can_, set the printer to PS mode. It's the easiest thing. You just need the system's (!) lpr subsystem to feed the PS jobs into the printer. If PS is not possible, use PCL. If you really, REALLY require features of the printer that need to be addressed by the PPD mechanism, use CUPS, even if I can't imagine such features (because gs lets you address things like paper tray preference, duplexer and so on through PCL commands). -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...