Extrait du Postscript Language Reference Manual 3rd Ed. à 6.1.1 :
Note: setpagedevice is a page-oriented operator used to control the output process-
ing of one or more pages of a page description. Any call to setpagedevice implicitly
invokes erasepage and initgraphics, and thus must precede the descriptions of the
pages to be affected. If the current device is not a page device, the effect of invoking
setpagedevice is device-dependent.
Essayez donc d'ouvrir le fichier PostScript dans un éditeur de texte et d'insérer les "<".
Duplex boolean A flag determining whether the output is to be printed duplex (on both sides
of the physical medium) or simplex (on one side of the medium only). If this
flag is true, pairs of consecutive page images will be printed on opposite sides
of a single sheet of medium; if false, each page will be printed on a separate
sheet.
On device activation, a duplex device always prints the first page on a new
sheet of medium; on deactivation, it automatically delivers the last sheet of
medium if it has been printed on only one side.
Tumble boolean A flag specifying the relative orientation of page images on opposite sides of a
sheet of medium in duplex output (that is, when Duplex is true). If Tumble is
false, the default user spaces of the two pages are oriented suitably for binding
at the left or right, with vertical (y) coordinates in the two spaces increasing
toward the same edge of the physical medium. If Tumble is true, the default
user spaces are oriented suitably for binding at the top or bottom, with verti-
cal coordinates increasing toward opposite edges of the medium. If Duplex is
false, the Tumble parameter has no effect.
Note that Tumble is defined in terms of default user space—the user space
established by setpagedevice. The orientation of default user space with re-
spect to the medium is determined by the PageSize and Orientation
parameters, possibly altered by the Install procedure. Consistent results are
obtained across all devices that support duplexing, regardless of how the me-
dium moves through the printing mechanism. However, if a page description
alters user space by invoking operators such as rotate, the visual orientation
of the material printed on the page may differ from the orientation of default
user space.
EDIT : Maintenant je vois le problème. J'ai pu modifier votre approche pour insérer les chaînes dans le postscript mais je ne peux pas vérifier l'impression recto-verso avec mon imprimante simplex. Le ghostscript insère les chaînes correctes dans le %%BeginPageSetup comme prévu :
-c "<</PSPageOptions [ ( (page +1) print) (<</Duplex true>> setpagedevice) ( (page 2+) print) ] /LockDistillerParams true>> setdistillerparams"
Les première et troisième pages émettent les chaînes de pages et j'ai trouvé le setpagedevice à l'endroit correct pour la page +2 donc j'espère que tout fonctionne. Votre première tentative était très proche et j'ai aussi appris quelque chose.
page +1>>showpage, press <return> to continue<<
>>showpage, press <return> to continue<<
page 2+>>showpage, press <return> to continue<<
page +1>>showpage, press <return> to continue<<
>>showpage, press <return> to continue<<
page 2+>>showpage, press <return> to continue<<
page +1>>showpage, press <return> to continue<<