For Programmers: Free Programming Magazines  


Home > Archive > PostScript > January 2006 > Duplex mode









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Duplex mode
Alain Reymond

2006-01-12, 7:04 pm

Hello,

Is it possible in postscript to print sections of a document in duplex
(recto-verso) mode but not the entire file ?

I have the following problem : an application we wrote generates reports
for patients. Some part of the report (commentaries) could be printed
in duplex mode, some must stay in recto only mode.

Example :

(first)
Page 1
Page 2
(begin commentary)
Page 3,4 (duplex)
Page 5,6 (duplex)
(end commentary)

(second)
Page 1
Page 2
(begin commentary)
Page 3,4 (duplex)
Page 5,6 (duplex)
Page 7,8 (duplex)
Page 9 (duplex)
(end commentary)

Commentaries vary in size and can have an odd or even number of pages.
I would like to avoid counting pages and add a white page unless there
is no other possibility.

The idea is :

(first)
Page 1
Page 2
enable duplex
Page 3,4 (duplex)
Page 5,6 (duplex)
disable duplex
(second)
Page 1
Page 2
enable duplex
Page 3,4 (duplex)
Page 5,6 (duplex)
Page 7,8 (duplex)
Page 9 (duplex)
disable duplex

all that in the same file.

Is it possible.

Regards.

Alain






Helge Blischke

2006-01-12, 7:04 pm

Alain Reymond wrote:
>
> Hello,
>
> Is it possible in postscript to print sections of a document in duplex
> (recto-verso) mode but not the entire file ?
>
> I have the following problem : an application we wrote generates reports
> for patients. Some part of the report (commentaries) could be printed
> in duplex mode, some must stay in recto only mode.
>
> Example :
>
> (first)
> Page 1
> Page 2
> (begin commentary)
> Page 3,4 (duplex)
> Page 5,6 (duplex)
> (end commentary)
>
> (second)
> Page 1
> Page 2
> (begin commentary)
> Page 3,4 (duplex)
> Page 5,6 (duplex)
> Page 7,8 (duplex)
> Page 9 (duplex)
> (end commentary)
>
> Commentaries vary in size and can have an odd or even number of pages.
> I would like to avoid counting pages and add a white page unless there
> is no other possibility.
>
> The idea is :
>
> (first)
> Page 1
> Page 2
> enable duplex
> Page 3,4 (duplex)
> Page 5,6 (duplex)
> disable duplex
> (second)
> Page 1
> Page 2
> enable duplex
> Page 3,4 (duplex)
> Page 5,6 (duplex)
> Page 7,8 (duplex)
> Page 9 (duplex)
> disable duplex
>
> all that in the same file.
>
> Is it possible.
>
> Regards.
>
> Alain


It depends ....
All PostScript interpreters which support language level 2 or higher *should* support
changing between simplex and duplex printing via approbriate setpagedevice statements
bracketed by save and restore.

But I know a couple of PS interpreters (even some interpreters based on Adobe licenses
but modified by OEM) do not. Moreover, there are printers which require duplex/simplex
siwtching to be done by PJL commands ...

Thus, if you cannot trust your PS printer(s), I'd suggest to print the whole job as duplex
and insert empty verso pages where needed.

To test if your printer is compliant, craft a PS job following the following skeleton:

%!
% ... necessary comments, resources etc.
%%BeginSetup
<</Duplex false>>setpagedevice
%%EndSetup
%%Page: 1 1
% ... any content
showpage
%%Page: 2 2
% ... something
showpage
userdict/jobsave save put
<</Duplex true>>setpagedevice
% the following pages shoeuld be printed in duplex mode
%%Page: 3 3
% ... recto contents
showpage
%%Page: 4 4
% ... verso contents
showpage
%%Page: 5 5
% ... recto contents
showpage
userdict/jobsave get restore
% this should cause the sheet containing page 5 to be ejected
% and switch back to simplex mode
%%Page: 6 6
% ... some stuff
showpage
%%Page: 7 7
% ... more stuff
showpage
%%EOF


Note that this is not DSC compliant and might be garbled if fed through a spooler
which depends on DSC conformance like CUPS.

Helge


--
Helge Blischke
Softwareentwicklung
SRZ Berlin | Firmengruppe besscom
http://www.srz.de
Alain Reymond

2006-01-14, 6:58 pm

Helge Blischke a écrit :
> Alain Reymond wrote:
>
>
>
> It depends ....
> All PostScript interpreters which support language level 2 or higher *should* support
> changing between simplex and duplex printing via approbriate setpagedevice statements
> bracketed by save and restore.
>
> But I know a couple of PS interpreters (even some interpreters based on Adobe licenses
> but modified by OEM) do not. Moreover, there are printers which require duplex/simplex
> siwtching to be done by PJL commands ...
>
> Thus, if you cannot trust your PS printer(s), I'd suggest to print the whole job as duplex
> and insert empty verso pages where needed.
>
> To test if your printer is compliant, craft a PS job following the following skeleton:
>
> %!
> % ... necessary comments, resources etc.
> %%BeginSetup
> <</Duplex false>>setpagedevice
> %%EndSetup
> %%Page: 1 1
> % ... any content
> showpage
> %%Page: 2 2
> % ... something
> showpage
> userdict/jobsave save put
> <</Duplex true>>setpagedevice
> % the following pages shoeuld be printed in duplex mode
> %%Page: 3 3
> % ... recto contents
> showpage
> %%Page: 4 4
> % ... verso contents
> showpage
> %%Page: 5 5
> % ... recto contents
> showpage
> userdict/jobsave get restore
> % this should cause the sheet containing page 5 to be ejected
> % and switch back to simplex mode
> %%Page: 6 6
> % ... some stuff
> showpage
> %%Page: 7 7
> % ... more stuff
> showpage
> %%EOF
>
>
> Note that this is not DSC compliant and might be garbled if fed through a spooler
> which depends on DSC conformance like CUPS.
>
> Helge


Helge,

I thank you. It works! But....

Il use paper with a logo on one side and when I start the duplex mode,
the pages are printed in the reverse order. I mean

%!
% ... necessary comments, resources etc.
%%BeginSetup
<</Duplex false>>setpagedevice
%%EndSetup
%%Page: 1 1
% ... page is printed with the logo OK. Nothing on the verso.
showpage
%%Page: 2 2
% ... page is printed with the logo OK. Nothing on the verso.
showpage
userdict/jobsave save put
<</Duplex true>>setpagedevice
% the following pages are printed in duplex mode
%%Page: 3 3
% ... recto contents
% ... page is printed withouth logo on the verso of the paper sheet.
showpage
%%Page: 4 4
% ... verso contents
% ... page is printed with the logo.
showpage
%%Page: 5 5
% ... recto contents
% ... page is printed withouth logo on the verso of the paper sheet.
showpage
userdict/jobsave get restore
% ... back to simplex mode
% ... paper is ejected.
%%Page: 6 6
% ... page is printed with the logo OK. Nothing on the verso.
showpage
%%Page: 7 7
% ... page is printed with the logo OK. Nothing on the verso.
showpage
%%EOF

And if I reverse the paper in the tray, I have the reversed problem with
the pages not printed in duplex!

I works perfect on white paper. But with paper with logo on one face,
the paper is reversed in the duplex portions of the printout!

Is there a possibility to avoid this problem ?

If not, whe shall put the logo in an eps file and print it instead of
puting our logo-paper in the printer!

Regards.

Alain
Helge Blischke

2006-01-14, 6:58 pm

Alain Reymond wrote:
>
> Helge Blischke a écrit :
>
> Helge,
>
> I thank you. It works! But....
>
> Il use paper with a logo on one side and when I start the duplex mode,
> the pages are printed in the reverse order. I mean
>
> %!
> % ... necessary comments, resources etc.
> %%BeginSetup
> <</Duplex false>>setpagedevice
> %%EndSetup
> %%Page: 1 1
> % ... page is printed with the logo OK. Nothing on the verso.
> showpage
> %%Page: 2 2
> % ... page is printed with the logo OK. Nothing on the verso.
> showpage
> userdict/jobsave save put
> <</Duplex true>>setpagedevice
> % the following pages are printed in duplex mode
> %%Page: 3 3
> % ... recto contents
> % ... page is printed withouth logo on the verso of the paper sheet.
> showpage
> %%Page: 4 4
> % ... verso contents
> % ... page is printed with the logo.
> showpage
> %%Page: 5 5
> % ... recto contents
> % ... page is printed withouth logo on the verso of the paper sheet.
> showpage
> userdict/jobsave get restore
> % ... back to simplex mode
> % ... paper is ejected.
> %%Page: 6 6
> % ... page is printed with the logo OK. Nothing on the verso.
> showpage
> %%Page: 7 7
> % ... page is printed with the logo OK. Nothing on the verso.
> showpage
> %%EOF
>
> And if I reverse the paper in the tray, I have the reversed problem with
> the pages not printed in duplex!
>
> I works perfect on white paper. But with paper with logo on one face,
> the paper is reversed in the duplex portions of the printout!
>
> Is there a possibility to avoid this problem ?
>
> If not, whe shall put the logo in an eps file and print it instead of
> puting our logo-paper in the printer!
>
> Regards.
>
> Alain


Tell us what printer you use - I suspect the only solution is inserting dummy verso pages as I
sketched out. Since we run a Xerox Phaser 7400 at out site, we know there ARE printers that
require the recto side of the paper differently depending on simplex or duplex printing.

I think this is completely wicked, but the only thing you can do is buy another printer ...

Helge

--
Helge Blischke
Softwareentwicklung
SRZ Berlin | Firmengruppe besscom
http://www.srz.de
Alain Reymond

2006-01-15, 7:12 pm

Helge Blischke a écrit :
> Alain Reymond wrote:
>
>
>
> Tell us what printer you use - I suspect the only solution is inserting dummy verso pages as I
> sketched out. Since we run a Xerox Phaser 7400 at out site, we know there ARE printers that
> require the recto side of the paper differently depending on simplex or duplex printing.
>
> I think this is completely wicked, but the only thing you can do is buy another printer ...
>
> Helge
>


Helge,

This is a Kyocera FSC8026N with duplex unit, many trays, etc...
We are satisfied with it.
Anyway, thanks again for the suggestion. Maybe, I'll count and introduce
a white page when necessary.

Regards.
Mit freundlichen Gruessen,

Alain
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com