Bug 690041 - Duplex working in 8.56 version, broke in 8.6x versions
Summary: Duplex working in 8.56 version, broke in 8.6x versions
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Printer Driver (show other bugs)
Version: 8.60
Hardware: PC Windows XP
: P2 normal
Assignee: Ray Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-25 18:32 UTC by Marvin Steakley
Modified: 2011-09-18 21:46 UTC (History)
0 users

See Also:
Customer: 351
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marvin Steakley 2008-08-25 18:32:56 UTC
On MS Windows (version does not matter) duplex code in a Postscript file worked
correctly in version 8.56.  (This is using the mswinpr2 driver.)  Some change
was made since and it is no longer working.  To recreate, follow these steps:

1) Set your default printer to a printer that supports duplex printing.
2) Create a file called duplex.ps with this contents:

mark
  /NoCancel      true                       % don't show the cancel dialog
  /BitsPerPixel  1                          % force 1 bit/pixel
  /QueryUser     3                          % use default printer
  /UserSettings
    <<
      /DocumentName  (Immediate print ltr)  % name for the Windows spooler
      /MaxResolution 600                    % maximum document resolution
    >>
  (mswinpr2) finddevice                     % select the Windows device driver
  putdeviceprops
setdevice
<< /Duplex true /Tumble false >> setpagedevice

3) Execute this command line:

     gswin32c -dBATCH -dNOPAUSE duplex.ps any-muli-page-document.pdf

4) If you run as above with 8.56, the document prints duplex.  If you run with
8.6x, the document prints simplex.  I've have not tested with 8.57, I never
bothered to install that version.
Comment 1 Ray Johnston 2008-09-13 11:15:42 UTC
The /Duplex key was added to the .outputattrkeys list in gs_setpd.ps with
the massive 'cups merge' (rev 8026). This broke Duplex for all devices since
it would be forced false by the .presentspecial logic invoked by
.prepareparams

This may be a factor in several other open bugs that mention Duplex:
689048    Duplex not working with pswrite device
689174    Pages
689363    Duplex information embedded within the document not honored
689729    Preserve copy count when converting PostScript to PCL-XL

Since there is no detailed documentation on this change, I recommend the
following patch. Then we can re-evaluate all of the other bugs and close
those that are fixed.

Log message:

Revert .outputattrkeys to the list prior to rev 8026 to fix problems with
Duplex introduced with that change.

Index: Resource/Init/gs_setpd.ps
===================================================================
--- Resource/Init/gs_setpd.ps   (revision 9084)
+++ Resource/Init/gs_setpd.ps   (working copy)
@@ -421,7 +421,7 @@
 
   % Define the keys used in output attribute matching.
   /.outputattrkeys [
-    /OutputType /Duplex /Tumble /ManualFeed
+    /OutputType
   ] readonly def
 } ifelse
--------------------------------------------------------------------------

Assigning to Alex for patch review.
Comment 2 Marcos H. Woehrmann 2008-09-19 11:42:59 UTC
Upping the priority since a customer has reported the same issue.
Comment 3 Alex Cherepanov 2008-10-20 18:06:25 UTC
I agree with the patch. PLRM (p. 416) says that /OutputType is the
only attribute in the subdirectories of /OutputAttributes dictionary.
Comment 4 Ray Johnston 2009-01-13 10:39:08 UTC
Patch committed as rev. 9350.
Comment 5 Marcos H. Woehrmann 2011-09-18 21:46:47 UTC
Changing customer bugs that have been resolved more than a year ago to closed.