Article View: comp.lang.postscript
Article #5220Re: Pageview problem
From: Glenn Reid
Date: Sat, 30 Mar 1991 22:37
Date: Sat, 30 Mar 1991 22:37
47 lines
2961 bytes
2961 bytes
Vidiot writes
> But, I have to agree with the logic at Sun regarding how pageview works.
> As pointed out in my previous posting, pageview considers the next instance
> of %! to mean that another PostScript document has been included and to
> ignore all comments until the next %%Trailer, which better be part of the
> included document. Then it will look at the comments again. This idea
> here, as I gather it, is that the included document is part of the page
> that it is trying to display. The included document should only really
> be one page and part of the page it was included with.
>
> Well, groff kind-of messes up that logic. By adding the %! line again,
> pageview thought that another PostScript file was included and rightfully
> displayed everything until the %%Trailer came along. In this case, there
> wasn't an included document. I agree with the person responsible for the
> pageview code. If the offending %! is edited from the groff document, the
> document is displayed correctly, one page at a time. With the -DBROKEN_
> SPOOLER flag turned on, it too displays correctly.
>
> I feel that groff should not put in the extra %! line at all. It is the
> only thing that fools pageview, no matter what the state of -DBROKEN_SPOOLER.
> Either PostScript output will display correctly, except as noted.
There is a specific convention for dealing with embedded PS files, and
looking for %! is not it. After all, %! means very little, in that it is
not even claming to be a conforming document. In addition, the %%Trailer
comment is optional, and may contain code following the trailer in any
case. It is certainly a bad idea to do what pageview is described as
doing.
The comments %%BeginDocument and %%EndDocument were created for this
purpose; a spooler could safely skip matching pairs of these comments,
and the comments between them, when scanning a document. Looking for
%! and %%Trailer is simply not reliable, and in fact would almost never
work, it seems to me.
The BROKEN_SPOOLER constant is useful, although perhaps it should be
BROKEN_PREVIEWER.
Remember, %! just means that the file is PostScript, not that it represents
a document or anything else. It can appear an arbitrary number of times
within a document. It is only significant as the very first two characters
in a file.
--
Glenn Reid RightBrain Software
glenn@heaven.woodside.ca.us NeXT/PostScript developers
..{adobe,next}!heaven!glenn 415-851-1785 (fax 851-1470)
Technical Details
Message-ID:
<464@heaven.woodside.ca.us>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!adobe!heaven!heaven.woodside.ca.usReferences:
<1561@vidiot.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!adobe!heaven!heaven.woodside.ca.us From: glenn@heaven.woodside.ca.us (Glenn Reid) Newsgroups: comp.lang.postscript Subject: Re: Pageview problem Keywords: pageview %! structuring conventions Message-ID: <464@heaven.woodside.ca.us> Date: 30 Mar 91 22:37:41 GMT References: <1561@vidiot.UUCP> Sender: glenn@heaven.woodside.ca.us Lines: 47