From owner-freebsd-questions@freebsd.org Mon Sep 14 11:30:39 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 261C1A0476D for ; Mon, 14 Sep 2015 11:30:39 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD4BD1E8A for ; Mon, 14 Sep 2015 11:30:38 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-125-111.dynamic.qsc.de [92.195.125.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id 49E8E24DA6; Mon, 14 Sep 2015 13:30:36 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id t8EBUaL2010707; Mon, 14 Sep 2015 13:30:36 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Mon, 14 Sep 2015 13:30:36 +0200 From: Polytropon To: Warren Block Cc: reg@dwf.com, freebsd-questions@freebsd.org Subject: Re: (Thanks) network/Postscript Printer problem Message-Id: <20150914133036.4a325347.freebsd@edvax.de> In-Reply-To: References: <201509130653.t8D6rLr8006399@deneb.dwf.com> <55F564D6.3090106@bananmonarki.se> <20150913142321.293c85e2.freebsd@edvax.de> <201509132148.t8DLm1UY015441@deneb.dwf.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2015 11:30:39 -0000 On Sun, 13 Sep 2015 21:33:54 -0600 (MDT), Warren Block wrote: > On Sun, 13 Sep 2015, reg@dwf.com wrote: > > > > > Thanks to all that responded, I finally got rid of > > a couple of nasty typos, and the printer is working. > > > > I should be able now to put together a couple of > > input filters to do single/double sided printing. > > This thread in the forums is a couple of years old, but shows some > examples of creating a duplex-printing filter: > https://forums.freebsd.org/threads/lpd-print-filters.40651/ To enrich the mailing list with some examples, I'd like to share my own "printer filter" for duplex functionality. :-) I have defined two printers, "Laserjet" and "Laserjer-nodup" in /etc/printcap, created their spool directories and made them almost identical, except for the printer filters, which themselves are almost identical, as you'll see: This is the duplex filter: /opt/libexec/ps2pcl-dup.sh #!/bin/sh /usr/bin/printf "\033&k2G" || exit 2 /usr/local/bin/gs -q -dBATCH -dNOPAUSE -dPARANOIDSAFER -dSAFER \ -sDEVICE=ljet4d -sPAPERSIZE=a4 -r600x600 \ -dDuplex=true \ -sOutputFile=- - && exit 0 exit 2 And this is the simplex filter: /opt/libexec/ps2pcl-nodup.sh #!/bin/sh /usr/bin/printf "\033&k2G" || exit 2 /usr/local/bin/gs -q -dBATCH -dNOPAUSE -dPARANOIDSAFER -dSAFER \ -sDEVICE=ljet4d -sPAPERSIZE=a4 -r600x600 \ -sOutputFile=- - && exit 0 exit 2 However, those filters translate the input PS to output PCL. I did this because the printer in question (HP Laserjet 4000 DN) will print PCL faster than PS. That's the only reason. You need to install the Ghostscript port (gs) for this task. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...