[comp.lang.postscript] Procedures over page boundaries

joe@etac632 (Joe Fulson-Woytek) (01/23/90)

I am trying to write a Postscript file with a procedure defined in one page
and invoked on both that page and subsequent pages. I know that defining
the procedure in the prologue like this:
     /pr1 {
   % include procedure here
     } def
   %%EndProlog
   %%Page:? ?
   % do some postscript stuff
   % invoke the procedure
    pr1
    gsave showpage grestore
   % go to a new page
   %%Page:? ?
   % do some other postscript stuff
   % invoke the procedure
    pr1
    gsave showpage grestore
   % go to a new page
   %%Page:? ?
works fine. The commands in the procedure pr1 are executed on both pages.
I need, however, the following sequence to work:
   %%EndProlog
   %%Page:? ?
   % do some postscript stuff
     /pr1 {
   % include procedure here
     } def
   % invoke the procedure
    pr1
    gsave showpage grestore
   % go to a new page
   %%Page:? ?
   % do some other postscript stuff
   % invoke the procedure
    pr1
    gsave showpage grestore
   % go to a new page
   %%Page:? ?
In this case, the commands in pr1 are executed on the first page, but not
on the second. The Adobe Postscript manuals are not very illuminating as to
what happens when you go to a new page. The save/restore commands looked 
promising but I couldn't figure out if they are what I need, and how to
use them in this case. Since I've only tried this on a postscript viewer
on my Iris 4d workstation, I am willing to accept the reponse that this
should work- in which case the fault might be with the Iris. 
Any suggestions would be appreciated. If you e-mail to me at
joe@etac632.gsfc.nasa.gov, I will summarize the responses. Thanks.
               Joe Fulson-Woytek