Bug 689048 - Duplex not working with pswrite device
Summary: Duplex not working with pswrite device
Status: RESOLVED WONTFIX
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Writer (show other bugs)
Version: 8.50
Hardware: PC Windows XP
: P4 normal
Assignee: Marcos H. Woehrmann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-17 08:51 UTC by Ben Byrne
Modified: 2010-07-08 07:26 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Byrne 2007-01-17 08:51:03 UTC
I run a simple postscript file through ghostscript using the pswrite device. The
postscript input file has the setpagedevice commands:

<< /PageSize [595 742] /Duplex true ) >> setpagedevice

The A4 PageSize is passed into the output file, but not the Duplex command. I
cannot tell by the documention if this Duplex command should pass through to the
output file. I also tried the command line parameter -dDuplex. It didn't work
either.

command line used:
C:\gs\gs8.50\bin\gswin32c -q -dNOPAUSE -dBATCH -dLanguageLevel=2
-sDEVICE=pswrite -sOutputFile=%2 -f %1

postscript sample:
%!PS
<< /PageSize [595 742] /Duplex true ) >> setpagedevice
72 720 moveto
/Courier 12 selectfont
(hello world!) show
showpage
Comment 1 Hin-Tak Leung 2007-01-20 12:29:18 UTC
There is a syntax error with the example - the extra ")" in setpagedevice.
But, yes, the /Duplex seems to be gone from the output.
Comment 2 Ray Johnston 2007-04-12 12:11:41 UTC
Customer ID field is for licensed Artifex OEM customers. 
Comment 3 David 2010-07-07 22:56:34 UTC
~3years, gs still doesn't have duplex in pswrite output.  any plans to change it?
Comment 4 Ken Sharp 2010-07-08 07:26:19 UTC
(In reply to comment #3)
> ~3years, gs still doesn't have duplex in pswrite output.  any plans to change
> it?

Not really. The problem is that the input file is fully interpreted to graphics primitives (marking operations) which are then sent to the graphics library for output. In the case of pswrite (and other high level devices) instead of producing rendered output these are instead converted into high-level marking operations and re-emitted, in this case as PostScript.

Note that this is the same model for all input and output languages, thus it doesn't matter whether the input is PostScript, PDF, PCL, XPS or SVG, and the output driver can be (currently) either PostScript or PDF. 

'metadata', like Duplex, Tumble and a myriad of other device-specific settings, including many which are relevant only to a specific device such as HP colour control, do not mark the output and so there is no simple way to pass this data through to the output. Also even if it were possible, it is equally likely that users would complain that this data *wasn't* being stripped off, and causing problems in their workflow. Just because the input file is duplexed doesn't mean the user wants the output file to be duplex.

The 'correct' way to handle this is to create an application which can be supplied with a PPD file for the printer, and can display a dialog for the user to select the device settings (ideally inheriting any appropriate settings from the input file). This is well beyond the scope of a device in Ghostscript.

Simply prepend the file created by pswrite with an appropriate setpagedevice.