[comp.lang.postscript] Psroff meets Pageview.

clewis@ferret.ocunix.on.ca (Chris Lewis) (02/05/91)

One of the people using psroff is using X11 pageview to
view the Postscript that psroff generates, and is encountering
a problem which someone may be able to solve.  Namely, each
page overlaps rather than replaces the previous page.
(eg: no erase is occuring of the previous page)

Psroff generates Adobe 1.0 conformant format files, which have
prologs, "%%Page:"'s and "%%Trailer:".  The postscript isn't
particularly complicated.  Pages look something like:
	%%Page: ? 1
	(string) x-value y-value Y
	(string) x-value X
	ShowPage
Y and X are routines that place the string at the coordinates
specified by the x-value and y-value numeric constants (X uses the
previous y coordinate).  ShowPage consists of just "showpage"
plus an increment of a page counter.  Replacing the ShowPage with
showpage doesn't appear to solve the problem.  There are occasional
font definitions using another function I've defined in the prolog.
(the font definition function is fairly complicated because I'm
trying to cache definitions, rather than findfont/scalefont/setfont
invocations each time)

Does anybody know why pageview could be doing this?  Any suggestions
that might solve the problem?

Thanks,

jeffe@eniac.seas.upenn.edu (George Jefferson ) (02/06/91)

In article <1272@ecicrl.ocunix.on.ca> clewis@ferret.ocunix.on.ca (Chris Lewis) writes:
:One of the people using psroff is using X11 pageview to
:view the Postscript that psroff generates, and is encountering
:a problem which someone may be able to solve.  Namely, each
:page overlaps rather than replaces the previous page.
:(eg: no erase is occuring of the previous page)
:
:Does anybody know why pageview could be doing this?  Any suggestions
:that might solve the problem?
:

Dont know why, but for what it is worth pageview does the same thing
with macintosh | macps postscript files as well.  ( I wasn't suprised )




--
-george            george@mech.seas.upenn.edu

dan@kfw.COM (Dan Mick) (02/06/91)

In article <1272@ecicrl.ocunix.on.ca> clewis@ferret.ocunix.on.ca (Chris Lewis) writes:
>One of the people using psroff is using X11 pageview to
>view the Postscript that psroff generates, and is encountering
>a problem which someone may be able to solve.  Namely, each
>page overlaps rather than replaces the previous page.
>(eg: no erase is occuring of the previous page)

I don't know who makes pageview, but they're wrong.  GhostScript and GoScript
both clear the page on showpage, and of course printers print the page on
showpage.

The Adobe Blue Book says 

- _showpage_ -      output and reset current page
- _copypage_ -      output current page
- _erasepage_ -     paint current page white

You could work around the problem with erasepage, but there should be no need.
pageview should be clearing on showpage.

Whose is it, btw?  Sun's?

jgreely@morganucodon.cis.ohio-state.edu (J Greely) (02/07/91)

In article <1272@ecicrl.ocunix.on.ca> clewis@ferret.ocunix.on.ca
 (Chris Lewis) writes:
>One of the people using psroff is using X11 pageview to
>view the Postscript that psroff generates, and is encountering
>a problem which someone may be able to solve.

Do you mean psroff shipped with Adobe TranScript 2.1, and pageview
shipped with OpenWindows 2.0?  If so, your problem may be that the
psroff output is missing a %%Pages: line (pageview will only display
conforming documents, and opinions on conforms vary wildly).  If not,
what software are you talking about?

>Namely, each
>page overlaps rather than replaces the previous page.
>(eg: no erase is occuring of the previous page)

Is it stopping to let you see the page?  If not, that's the normal
behavior when confronted with PostScript that doesn't fit its
definition of "conforming".
--
J Greely (jgreely@cis.ohio-state.edu; osu-cis!jgreely)

sun@me.utoronto.ca (Andy Sun Anu-guest) (02/07/91)

clewis@ferret.ocunix.on.ca (Chris Lewis) writes:

>One of the people using psroff is using X11 pageview to
>view the Postscript that psroff generates, and is encountering
>a problem which someone may be able to solve.  Namely, each
>page overlaps rather than replaces the previous page.
>(eg: no erase is occuring of the previous page)

>Psroff generates Adobe 1.0 conformant format files, which have
>prologs, "%%Page:"'s and "%%Trailer:".  The postscript isn't
>particularly complicated.  Pages look something like:
>	%%Page: ? 1
>	(string) x-value y-value Y
>	(string) x-value X
>	ShowPage
>Y and X are routines that place the string at the coordinates
>specified by the x-value and y-value numeric constants (X uses the
>previous y coordinate).  ShowPage consists of just "showpage"
>plus an increment of a page counter.  Replacing the ShowPage with
>showpage doesn't appear to solve the problem.  There are occasional
>font definitions using another function I've defined in the prolog.
>(the font definition function is fairly complicated because I'm
>trying to cache definitions, rather than findfont/scalefont/setfont
>invocations each time)

>Does anybody know why pageview could be doing this?  Any suggestions
>that might solve the problem?

>Thanks,

I am using psroff from Abobe Transcript 2.1 and CAT troff and I do
encounter the above problem, sometimes. What I found out was that if you
renumber the page somewhere in the middle of the document (like using
i, ii, iii and suddenly restart with 1, 2, 3), PageView will screw up and
overlapping everything on one page. What I have to do now with documents
like this is to view those pages separately by using the -o option in
psroff.

I also ecountered this on Mac documents, but I have yet to find out
what really happens in the case of a Mac.

Andy

_______________________________________________________________________________
Andy Sun                            | Internet: sun@me.utoronto.ca
University of Toronto, Canada       | UUCP    : ...!utai!me!sun
Dept. of Mechanical Engineering     | BITNET  : sun@me.utoronto.BITNET

pete@TIRS.oz.au (Peter Bartel) (02/08/91)

From article <1272@ecicrl.ocunix.on.ca>, by clewis@ferret.ocunix.on.ca 
(Chris Lewis):
> One of the people using psroff is using X11 pageview to
> view the Postscript that psroff generates, and is encountering
> a problem which someone may be able to solve.  Namely, each
> page overlaps rather than replaces the previous page.
> (eg: no erase is occuring of the previous page)
... 
> Does anybody know why pageview could be doing this?  Any suggestions
> that might solve the problem?

An extract from the groff 1.0 Makefile might shed a little light:
# Include -DBROKEN_SPOOLER in CPPDEFINES if you have a PostScript
# spooler or previewer that is unable to cope with anything after
# %%EndProlog and before the first page (old versions of TranScript
# have this problem and so does the Sun pageview previewer) or gets
# confused by included documents, or if you are going to be sharing
# PostScript documents with others who might be running such a spooler
# or previewer.

I played around with the %%EndProlog line withoug success. But then, I
don't know much about postscript.
> 
> Thanks,
No worries. Hope this points you in the right direction.
_______________________________________________________________________
Peter Bartel	Senior Software Engineer	International
Phone:		+61-8-232-1740			Railroad
Faxstream:	+61-8-232-2274			Systems
E-mail:		pete@TIRS.oz.au			(Electronics)
Snail:		209-217 Wakefield St, Adelaide, South Australia, 5000

henry@angel.Eng.Sun.COM (Henry McGilton) (02/09/91)

In article <1991Feb8.005229.18689@TIRS.oz.au>, pete@TIRS.oz.au (Peter Bartel) writes:
    *   From article <1272@ecicrl.ocunix.on.ca>, by clewis@ferret.ocunix.on.ca 
    *   (Chris Lewis):
    **  One of the people using psroff is using X11 pageview to
    **  view the Postscript that psroff generates, and is encountering
    **  a problem which someone may be able to solve.  Namely, each
    **  page overlaps rather than replaces the previous page.
    **  (eg: no erase is occuring of the previous page)
    **  Does anybody know why pageview could be doing this?  Any suggestions
    **  that might solve the problem?

    *   An extract from the groff 1.0 Makefile might shed a little light:
Stuff about DBROKEN_SPOOLER deleted.

    *  I played around with the %%EndProlog line withoug success. But
    *  then, I don't know much about postscript.

I looked into the problems and communicated some answers to Chris Lewis.

One problem you may run into is that the font definitions in the
psroff prolog uses the PostScript  reversepath  operator, which NeWS
doesn't implement.   I believe you'll only run into this problem if
your document contains certain kinds of math asking for one of the
special large parentheses building characters.  That is, if you use
eqn to do either of the constructs  left (  or  right ).

The problem of the overlapping pages is caused by an extraneous  %!
sign halfway through the psroff prolog.  PageView doesn't parse this
correctly, making an invalid assumption that the PostScript following
is an included file.  PageView looks for the end of the
included document, doesn't find it, and ends up assuming that the
entire document is one page, hence the overlapping problem.

For those who need instant gratification, look for the line that
reads:
	%       bracket building font
and delete the line that follows it.

	........  Henry