From owner-freebsd-questions@FreeBSD.ORG Tue Jan 28 03:13:12 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2FCB946 for ; Tue, 28 Jan 2014 03:13:11 +0000 (UTC) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8BBC21FB8 for ; Tue, 28 Jan 2014 03:13:11 +0000 (UTC) Received: from r56.edvax.de (port-92-195-149-155.dynamic.qsc.de [92.195.149.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id A25BB3CC14; Tue, 28 Jan 2014 04:13:02 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id s0S3CbeI002641; Tue, 28 Jan 2014 04:12:37 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Tue, 28 Jan 2014 04:12:36 +0100 From: Polytropon To: freebsd@dreamchaser.org Subject: Re: upside down duplexed page -- CUPS issue (was Re: ps problem) Message-Id: <20140128041236.780f0dfe.freebsd@edvax.de> In-Reply-To: <52E5FC6B.3050600@dreamchaser.org> References: <52E55D4F.8060803@dreamchaser.org> <52E5E5EA.3060101@dreamchaser.org> <20140127060551.80c21869.freebsd@edvax.de> <52E5FC6B.3050600@dreamchaser.org> 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 Cc: FreeBSD Mailing List X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2014 03:13:12 -0000 On Sun, 26 Jan 2014 23:27:55 -0700, Gary Aitken wrote: > On 01/26/14 22:05, Polytropon wrote: > > On Sun, 26 Jan 2014 21:51:54 -0700, Gary Aitken wrote: > > >> 2. If I print it using > >> /usr/local/bin/lpr duplex.ps > >> it comes out with the duplexed page upside down. > > > > This will use CUPS's settings which may add a "preample" > > of PS to the printer to reflect those settings, for example > > which "duplexing manner" (long or short edge "wrap") will > > be used. > > Except that in this case the %cupsJobsTicket: comment should > instruct it to use long-edge duplexing, which should override > any cups default. The default for this printer is no-duplex, > so if it overrides it shouldn't duplex at all. Yes, "should", but the reality of complex software teaches that in many cases, things don't work as they should. :-) It would be required to capture the "postprocessed" PS that CUPS sends to the printer to be sure about what _exactly_ will be sent to the printer. Sometimes printers themselves can change things (duplex on/off, short/long edge etc.). > > To find out if those settings exist, open a web browser (bah) > > and go to http://localhost:631 where you can find the CUPS > > administration web pages. Check your printer's settings > > carefully. (I know there's also a lpadmin tool, but haven't > > bothered learning it because I tend to avoid CUPS whenever > > possible, because when you have a PS-capable printer, it's > > probably just useless overhead.) > > Checked that already, and it is set by default to not duplex. > So presumably its preamble would not change the duplexing. > But the document itself has embedded duplexing along the long > edge. Why would that result in the short-edge behavior? The wonder of modern software. :-) No, honestly: If you already have a good printer that can understand PS, and you don't require a _specific_ CUPS-only feature, I'd suggest to get rid of CUPS and use the system's printer spooler. You'll probably don't need any printer filter here. > >> If I create a simple 2 page document in openoffice, > >> when printing from openoffice, I see the following: > >> > >> 3. If printed duplexed direct from OO, duplexed pages are upside down. > > > > As expected. > > Why? Default is no duplex, but I turned long edge duplex on > in the print dialog. Strange case of conflicting pre- and postprocessing maybe? PS content changes and precedence? > >> 4. If printed to a pdf file and /usr/bin/lpr is used on the pdf, > >> no duplexing occurs -- I get two separate sheets. > > > > This could be explained by the way OO generates PDF and how > > the printer filters turn that into PS. Or if your printer is > > also capable of speaking PDF (directly), no mentioning that > > it should use duplex is in the PDF input. > > ok, at least that part makes sense. /usr/bin/lpr will ignore the > $cupsJobTicket: statement. Correct. It will send the PS _as is_ to the printer and let it deal with the PS content, which is defined by the PS interpreter's implementation "inside the printer". > >>From your PS source: > > > >> %cupsJobTicket: media=Letter sides=two-sided-long-edge > > > > There's also two-sided-short-edge (corresponding to the setting > > accessible via localhost:631). > > That's what I don't understand. > It says two-sided-long-edge. Why would it be performing as if > it said two-sided-short-edge? I'd imagine that there's a conflicting setting somewhere in the CUPS configuration. Instead of manually searching through the web interface, you could also search for options related to "duplex", "edge", or "tumble" in /usr/local/etc/cups in the configuration files and maybe the PPDs employed. For example, the string "*DefaultDuplex: DuplexNoTumble" looks promising. There are other entries related to that concept. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...