Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!sun-barr!newstop!exodus!wind.Eng.Sun.COM From: naughton@wind.Eng.Sun.COM (Patrick Naughton) Newsgroups: comp.windows.open-look Subject: Re: Pageview problem Message-ID: <10561@exodus.Eng.Sun.COM> Date: 27 Mar 91 18:00:54 GMT References: <35@ftms.UUCP> Sender: news@exodus.Eng.Sun.COM Reply-To: naughton@wind.Eng.Sun.COM (Patrick Naughton) Followup-To: comp.windows.open-look Organization: Sun Microsystems, Inc. - Mountain View, CA Lines: 108 In article <35@ftms.UUCP>, brown@ftms.UUCP (Vidiot) writes: |> |> Version OW 2.0 |> |> The pageview man page says "pageview renders a document, a page at a time,". |> To that I have to say BullShit :-( |> |> I have a couple of groff produced PostScript files, one containing three |> pages and the other 26 pages. Needless to say that when I bring up pageview |> and load each file, ALL of the pages get displayed. So much for each page at |> a time. |> |> Does anyone have a hint as to what pageview is looking for for pagebreaks? |> Does it want %%Page:? If so, the document has: %%Page: 1 1, etc. |> |> Is pageview broke or an I missing something? |> |> Thanks in advance. |> -- |> harvard\ |> ucbvax!uwvax!astroatc!ftms!brown |> rutgers/ |> INTERNET: spool.cs.wisc.edu!astroatc!ftms!brown Looks like it is once again time for my bi-annual "why does pageview care about comments?" explanation... Here it is pasted from a comp.lang.postscript discussion last year. Yes, pageview REQUIRES the Adobe Structuring Conventions to be followed to the letter. Many people have written programs which output PostScript as if they had never seen Appendix C of the RedBook; while others read it and chose to ignore it for reasons beyond me (Frame). Common errors range from having no comments at all, to misspelling "%%Page", to having code in the "no-mans-land" between the "%%EndProlog" and the first "%%Page:". I've even seen files which went to the trouble to insert comments, but made up their own like "%%BeginPage:" and "%%EndPage:"! A future version of PageView will have a "dumb mode" which will use showpage to step through a non-conforming document front to back with no random access. Here are the adobe structuring conventions which pageview enforces: Pageview sends the code from the beginning of the document to the %%EndProlog to the server first, then the code between the %%BeginSetup and %%EndSetup, (notice that it does not send any code between the %%EndProlog and %%BeginSetup, nor between the %%EndSetup and the first %%Page.) Then for each page you want to view, it interprets the code which is between %%Page 'n' and and the next %%Page: (or %%Trailer for the last page). %!PS-Adobe-2.1 %%BeginProcSet % You can make any definitions you want here, but cannot % change the state of the interpreter. This is the "prologue", % which can be permanently downloaded or made available once % for a large number of individual document bodies. %%EndProcSet %%EndProlog --- any code in here will be IGNORED! --- % ------------- cut here for permanent download of the prologue ---------- %%BeginSetup % You can change the state of the interpreter here, and % provide any job-specific setup like reencoding fonts. % Bear in mind that YOU are responsible for any state % you set here and how it is used by each page. The % structuring conventions just guarantee that it will % always be executed first, before any of the pages. The % structuring conventions to not dictate *which* page % will be the one to execute after setup. It could be % page 1, page 4, or page 15, depending on page selection % and reordering that may be done by the server. This section % is part of the individual document body, and must be % repeated with each document. It is not part of the prologue. %%EndSetup --- any code in here will be IGNORED! --- % ------------- cut here for page reordering or subsetting --------------- %%Page: "label" m % any code can go here. It may rely on prologue definitions % made before the %%EndProlog comment, and it may rely on % state set up in the Setup section ONLY IF it also leaves % that state set at the end of the page. This is because % the pages must not be interdependent, and any of them may % be executed in any order. % If a matrix representing the current matrix is stored into % a variable during setup, it is reasonable to use this value % with "setmatrix" to establish the coordinate system at the % beginning of each page. %%Page: "label" n % This is exactly the same as page "m" %%Trailer % The structuring conventions guarantee only that this code % will be executed last, after the final page. It is % appropriate here to remove your dictionaries from the % dictionary stack and to make sure you've left nothing % on the operand stack. %%EOF % If this is the end of job and an end-of-file would normally % appear here, this comment may be used to indicate end-of- % file in a transport-mechanism-independent manner. -- ______________________________________________________________________ Patrick J. Naughton email: naughton@sun.com Sun Laboratories voice: (415) 336 - 1080