6

Is there an easy way to force a postscript page onto a new physical page without inserting a blank page?

e.g. Say I have a PS document with 10 postscript pages, which needs to print into different document bundles :

1 - Physical Page 1 Front Side

2 - Physical Page 1 Rear Side

3 - Physical Page 2

4 - Physical Page 3 Front Side

5 - Physical Page 3 Rear Side

6 - Physical Page 4 Front Side

7 - Physical Page 5

8 - Physical Page 6 Front Side

9 - Physical Page 7 Front Side

10 - Physical Page 7 Rear Side

I could set the whole file to be duplex, and insert dummy pages after page 3,6,7 and 8, but I'd like to avoid that as our printers cost per impression, not per physical page.

I'm hoping there's a simple PS syntax which corresponds to "Force to front page".

Dane
  • 619
  • 5
  • 14

2 Answers2

5

Try turning duplex off and immediately back on where you would otherwise insert a blank page.

<< /Duplex false >> setpagedevice
<< /Duplex true >> setpagedevice

setpagedevice implicitly invokes erasepage and initgraphics (so use it after the relevant showpage), however the PostScript Language Reference Manual says:

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.

So, if this works, it should save a showpage but still eject the pages correctly.

dreamlax
  • 93,976
  • 29
  • 161
  • 209
0

This may be far-fetched, but you can change showpage behavior, and then program whatever you want.

% before the first -showpage-

/pageCount 0 def

% redefinition of 'showpage'
/showpage 
{
    showpage
    /pageCount pageCount 1 add def

    % add page checking here, and whatever logic you want
    % just call another showpage to create an empty one
}
bind def 
% 'bind' keeps old showpage unaltered, avoiding recursion

This is an option when disabling duplex is not possible, as dreamlax has shown in his answer.

Ricardo Nolde
  • 33,390
  • 4
  • 36
  • 40