From owner-freebsd-questions@freebsd.org Sat Jan 9 19:09:49 2016 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 4F594A69762 for ; Sat, 9 Jan 2016 19:09:49 +0000 (UTC) (envelope-from bah@bananmonarki.se) Received: from feeder.usenet4all.se (1-1-1-38a.far.sth.bostream.se [82.182.32.53]) (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 CBDCF1465 for ; Sat, 9 Jan 2016 19:09:47 +0000 (UTC) (envelope-from bah@bananmonarki.se) Received: from testbox.news4all.se (testbox.usenet4all.se [10.0.0.3]) by feeder.usenet4all.se (8.13.1/8.13.1) with ESMTP id u09J9hEo081810 for ; Sat, 9 Jan 2016 20:09:43 +0100 (CET) (envelope-from bah@bananmonarki.se) Subject: Re: Printer question To: freebsd-questions@freebsd.org References: <5690FCED.7000401@bananmonarki.se> <20160109143456.74f48f42.freebsd@edvax.de> <20160109143712.GA94931@becker.bs.l> From: Bernt Hansson Message-ID: <56915AF7.7020508@bananmonarki.se> Date: Sat, 9 Jan 2016 20:09:43 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160109143712.GA94931@becker.bs.l> Content-Type: text/plain; charset=windows-1252; format=flowed 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: Sat, 09 Jan 2016 19:09:49 -0000 On 2016-01-09 15:37, Bertram Scharpf wrote: > Hi, > > On Saturday, 09. Jan 2016, 14:34:56 +0100, Polytropon wrote: >> On Sat, 9 Jan 2016 13:28:29 +0100, Bernt Hansson wrote: >>> I have a question about laserjet printers that support HPGL. >>> >>> How do one switch from ps/pcl/pjl to hpgl the code for doing so under >>> dos is Ec%#B where # is 0 or 1. >>> >>> But how to do that with a print filter? >> /usr/bin/printf "Ec%1B" || exit 2 > First, it is not "Ec" (Letters E and c) but an escape (ASCII 0x1b). > > Second, the correct way to switch from PJL to another > language is to say something like > > print "@PJL ENTER LANGUAGE = HPGL2\r\n" > > Probably it's a good idea to ensure you're in PJL mode > before giving PJL commands. > > print "\e%-12345X@PJL\r\n@PJL ENTER LANGUAGE = HPGL2\r\n" > > Maybe it could be even possible to go the whole way round to > PJL, from there to PCL and then to HPGL. > > print "\e%-12345X@PJL\r\n@PJL ENTER LANGUAGE = PCL\r\n\e%1B" > > You can see some output like that when you give the command > > $ echo "showpage" | gs -q -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -sDEVICE=ljet4pjl -r600 -sOutputFile=- - | less > > I will not tie myself to an exact answer because I do not > know which printer model you're using. Sorry, It's hp laserjet p2055d and laserjet 2100n even an officejet G55. > Just play around > until you found a solution that works. I will. Just wanted a ballpark to begin with. > Bertram /B