[comp.lang.postscript] Multiple %!s legal?

laba-4he@e260-4g.berkeley.edu (The Cybermat Rider) (05/08/89)

Ever so often, I come across a PostScript file that contains multiple %!s
(the obligatory one at the beginning and the others scattered throughout the
file).  The upshot of this phenomenon is that the local LaserWriter only
prints the pages _following the last %! in the file_, which naturally causes
me no end of grief.

The sections of the file concerned are usually included PostScript files
themselves, so the extra %!s are understandable.  Unfortunately, the
LaserWriter isn't so understanding -- it seems to treat %! as a
start-of-file marker, and since it starts printing from the last page.....

My questions: Are multiple %!s in a PostScript file legal?  What purpose(s)
does %! serve?

If it helps, the LaserWriter is running version 38.0 of PostScript.

Please email any responses -- I'll summarize to the net.

Thanks in advance for any info!

----------------------------------------------------------------------------
Adrian Ho a.k.a. The Cybermat Rider	  University of California, Berkeley
laba-4he@web.berkeley.edu		(WEB Evans, Home of The CS Freakies)
Disclaimer:  Nobody takes me seriously, so is it really necessary?

greid@adobe.com (Glenn Reid) (05/09/89)

In article <24121@agate.BERKELEY.EDU> laba-4he@e260-4g.berkeley.edu (The Cybermat Rider) writes:
>Ever so often, I come across a PostScript file that contains multiple %!s
>(the obligatory one at the beginning and the others scattered throughout the
>file).  The upshot of this phenomenon is that the local LaserWriter only
>prints the pages _following the last %! in the file_, which naturally causes
>me no end of grief.
>
>The sections of the file concerned are usually included PostScript files
>themselves, so the extra %!s are understandable.  Unfortunately, the
>LaserWriter isn't so understanding -- it seems to treat %! as a
>start-of-file marker, and since it starts printing from the last page.....
>
>My questions: Are multiple %!s in a PostScript file legal?  What purpose(s)
>does %! serve?
>

The printer ignores EVERYTHING that starts with %, including %!.  It is
just a programming convention, and is not enforced by the printer.

There are two possibilities that come to mind:

	1.  You have host-system spooling software that is paying
	    very close attention to %! and is slicing up the file
	    accordingly.  If it is, it is broken.  The %! is only
	    meaningful as the first two bytes in the file.

	2.  The dreaded control-D.  Look at the file with some kind
	    of binary microscope.  It is possible that these files
	    you are splicing together either end or begin with a
	    control-D, which will end the job.  If "showpage" has
	    not been executed, the job will terminate but nothing
	    will have printed.  The only solution is to call up
	    the software vendor and yell at him for putting ^D
	    in the file.  Just kidding.  The solution is to pain-
	    stakingly edit them by hand to remove ^D.

But in any case, it's not your printer.  It's all happening upstream
somwehere.

Glenn Reid
Adobe Systems