Bug 152448

Summary: Duplex not working with psnup -2
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Catia Lavalle <lavalle>
Component: PrintingAssignee: Johannes Meixner <jsmeix>
Status: RESOLVED DUPLICATE QA Contact: Johannes Meixner <jsmeix>
Severity: Normal    
Priority: P5 - None    
Version: unspecified   
Target Milestone: ---   
Hardware: x86-64   
OS: SuSE Linux 10.0   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Catia Lavalle 2006-02-21 11:16:13 UTC
Hello,
I have just changed my print server to a suse linux 10.0 x86-64 box.
The duplex itself is working without problem i.e. lpr -Pduplex file.ps prints duplex, but as soon as I print a file produced bu psnup -2 I get a single page print: i.e. psnup -2 file.ps|lpr -Pduplex --> 2 single pages (with 2 pages each sheet).
I already had this problem long time ago with the cd original cups of suse 9.0, in the net was marked as bug and it got fixed in the time.
In my  previous print server (suse 9.0 prof (i386),  cups 1.1.19-104) the duplex was working with psnup -2 (on the same printer).

The installed cups in the actual printer (where I have the problem) is: cups-1.1.23-21.2.
Comment 1 Johannes Meixner 2006-02-21 12:33:07 UTC
I wonder why it has ever worked.
This is a duplicate of bug #43507

Perhaps the next major CUPS version 1.2 has a changed pstops filter
which can work correctly even with the problematic PostScript output
of the psutils. Note that it is no bug in CUPS but in the psutils.

For number-up printing use the CUPS options and not the psutils,
see the "CUPS Software Users Manual": "Document Options".

If you want to print a booklet (which is not supported by the current
CUPS Document Options) use the workaround in bug #43507

*** This bug has been marked as a duplicate of 43507 ***
Comment 2 Johannes Meixner 2006-02-21 12:41:19 UTC
It seems bug 43507 is not public accessible.

Therefore here the explanation what exactly goes wrong
when using the psutils and the workaround from bug 43507:

On the CUPS mailing list the reason was explained:
---------------------------------------------------------------------------
The culprit is the pstops utility from the PSUtils package.
It inserts a procset into the PS job just after the
header comments which - among other tings - defines the
setpagedevice operator as a noop.
Thus, any defaults defined by your printer's PPD or given
as options in the print command are just ignored.
The only chance you'd have is with printers that need things
like media size, duplexing or the like to be specified by PJL
commands or with native IPP printers that natively support
these attributes via the IPP interface.
---------------------------------------------------------------------------


Workaround:

Create two PostScript code snippet files duplexnotumble.ps
---------------------------------------------------------------------------
%!PS
statusdict /setduplexmode known
{statusdict begin true setduplexmode end} if {} pop
---------------------------------------------------------------------------
and duplextumble.ps:
---------------------------------------------------------------------------
%!PS
statusdict /setduplexmode known
{statusdict begin true setduplexmode end} if {} pop
statusdict /settumble known
{statusdict begin true settumble end} if {} pop
---------------------------------------------------------------------------
You may have to adapt the exact PostScript code to fit
for your particular printer. 

Send this files before the real printing data to activate duplex
without or with tumble like in the following examples:

  echo -e "1\f2\f3\f4\f5\f6\f7\f" \
  | a2ps -1 -o - \
  | psnup -4 \
  | cat duplexnotumble.ps - \
  | lp -d QUEUE

to print 4 pages on one sheet with duplex

and

  echo -e "1\f2\f3\f4\f5\f6\f7\f" \
  | a2ps -1 -o - \
  | psnup -2 \
  | cat duplextumble.ps - \
  | lp -d QUEUE

to print 2 pages per sheet with duplex and tumble.