Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!purdue!decwrl!adobe!greid From: greid@adobe.com (Glenn Reid) Newsgroups: comp.lang.postscript Subject: Re: PS libraries Message-ID: <783@adobe.UUCP> Date: 25 Apr 89 22:15:57 GMT References: <2994@daisy.UUCP> <775@adobe.UUCP> <8751@polya.Stanford.EDU> Sender: news@adobe.COM Reply-To: greid@adobe.COM (Glenn Reid) Organization: Adobe Systems Incorporated, Mountain View Lines: 51 In article <8751@polya.Stanford.EDU> rokicki@polya.Stanford.EDU (Tomas G. Rokicki) writes: >> The hardest part about this is that PostScript programmers notoriously >> neglect this kind of possibility. For example, consider the following >> piece of code, which, despite the comments, you can't factor into one >> prologue plus more than one instance of the script. It's pretty common: >> >> /myprog save def >> %%BeginProcSet: prologue 1.0 0 > ... >> %%EndProcSet: prologue 1.0 0 > ... >> myprog restore >> Glenn Reid > >Okay, so where does a global save/restore go, in the context of EPSF? >(Don't tell me that we should assume the save/restore, as supplied by >the printer, because many people on microcomputers lack the proper >spooling software that sends ^D's at the end of the file.) The restore >has to go in the trailer. The save can't be in any of the pages. >Between the prologue and the pages? But I want to lose the prologue >definitions too, if possible. Comments? The save and restore pairs go around each page. And yes, I am going to tell you that you should assume the save/restore as supplied by the printer if you want to be a conforming PostScript file. If you want to protect yourself against the lowest common denominator (people who don't have the ability to add ^D), you give up the functionality of page reversal and conforming documents. If you are going to the trouble to write a preprocessor that can syntactically rearrange pages based on a sophisticated parser, I won't buy the argument that you can't add ^D at the end when you send it to the printer. The "proper spooling software" can consist of a two-line batch file that tacks an end-of-file indication at the end of each job. If you don't do this, page reversal will be the least of your problems. Anything printed that contains "exitserver" will cause the printer to use up memory indefinitely until it blows up, unless you terminate the job with an end-of-file. Anyway, forgive my impatience with the ^D issue. It is a plague on portability and on the world. But I will declare your program to be nonconforming if you put save/restore around the %%EndProlog boundary. It is worthy of note that it is possible to write a fully conforming PostScript file that begins with "save" and ends with "restore", as long as you put %%EndProlog before the first "save" and otherwise take care to stay within the restrictions of conforming documents. Glenn Reid Adobe Systems