[comp.lang.postscript] state between pages

rokicki@Neon.Stanford.EDU (Tomas G. Rokicki) (01/09/90)

Howdy, Amanda!

> Each page should be thought of as sitting inside a save/restore pair.

Correct.

> > %%Page 1
> > ... gsave showpage grestore
> > %%Page 2

> The '...'s are evil :-) if they change the global graphics state at all.

Agreed.

> > Thus, a program that attempts to 2-up this document cannot simply
> > redefine the `showpage' operator, as there could be any number of
> > (including zero) gsave/grestore pairs around showpage.  Rather,
> > the 2-up program needs to store away the initial state somewhere.
> > Then, after setup, it needs to divide the new state by the initial
> > state, and save this information away for its later use.  Each
> > `transformation' it wants to make must then be divided by this
> > new matrix we created before it is applied.
> 
> Well, inclusion of multi-page documents is a problem.  Aside from that,
> however, how about doing a 'save' after the setup, and a 'restore save'
> before each page?  That way, any transformations the new showpage does
> are automatically added to the ones that the setup did.

It's certainly possible to do it this way.  I'm just pointing out that not
every application does it this way nor even should necessarily do it this
way.  The 2-up (etc) programs should be smart enough to handle either (any)
case; I described above how such a program can do this.

> Amanda Walker
> InterCon Systems Corporation

Howdy, Amanda.  Thanks for the comments!

-tom