[gs-devel] Adding duplex support to pswrite

Seb James seb at esfnet.co.uk
Fri Nov 30 04:36:42 PST 2007


I'm just finding my way around ghostscript at the moment.

I notice that the -dDuplex cmd line switch is ignored by pswrite. I'd
really like to add it in. I notice Tobias Odell wanted to do this too
(or something like it), in January 2006 :


As a quick solution, I hacked ghostscript/src/gdevpsu.c to get a line
inserted in the output to switch on Duplex. As I don't know much about
postscript, I used the code snippet which Tobias wanted to add:

The extra code I want to add is:
<< /Duplex false >> setpagedevice

Only with "true" rather than "false".

So, Duplex printing is working. It'd be nice to be able to obtain the
value of the -dDuplex switch - i.e. if it was given on the gs cmd line
or not and use that to place this little bit of extra preamble in the
postscript output of pswrite.

My question is: Is there a data structure which I can access from code
in gdevpsu.c to get the command line parameters? That means a pointer to
a gs_param_list, I suppose.

I notice there's some new code to supercede pswrite - pswrite2 or
ps2write. Should I be using that now rather than pswrite? What
improvements does it already have over pswrite? I do notice that pswrite
generates very large print files which my HP1320 printer has trouble
coping with (I don't know how much RAM the printer has, but not enough,

With thanks in advance for any answers,

Seb James

More information about the gs-devel mailing list