[comp.lang.postscript] EPS and PS, the difference?

derosa@motcid.UUCP (John DeRosa) (03/23/90)

I am hot on the trail of a way to convert Sun Interleaf
to Macintosh Pict.  I thought I had the problem licked
but have reached another road block.

I have converted the Interleaf file to PS.  What I mean
by PS (postscript) is I have a file that is pure postscript
code starting with #! Adobe.  I then FTP'd the file
to the Mac and was able to print the file with programs
like Widgets and Postility.

Postility also says it can convert EPS (encapsulated postscript)
to Pict or Text.  This did nothing with my PS Interleaf file.

The question is; what is PS, and what is EPS?  Can one
be converted to the other?  Does anyone know the solution
to my conversion problem.  Thanks in advance for any help.

SIDE ISSUE: If I have a PS file from Interleaf, I can 
print it on the sun with the lpr command and I get the 
picture/document (not the PS code).  If I try the 
same file on the mac and print it with a text editor
like Edit, I get the PS code printout, not the 
picture/document (downloading it with Widgets works
fine).  Why the difference?

SECOND SIDE ISSUE:  A Macintosh PS file begins with 
the line #! Adobe 2.0, a Sun Interleaf PS file begins
with the line #! Adobe.  Does this mean that they are
different versions of PostScript?  The Sun file will
print on the Mac but the Mac file will NOT print on
the Sun. 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=    John DeRosa, Motorola, Inc, Cellular Infrastructure Division           =
=                   e-mail: ...uunet!motcid!derosaj                         =
= I do not hold by employer responsible for any information in this message =
=      nor am I responsible for anything my employer may do or say.         =
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

henry@angel.Sun.COM (Henry McGilton--Software Products -- R.I.P.) (03/23/90)

In article <1816@diamond2.UUCP>, derosa@motcid.UUCP (John DeRosa) writes:
    *  I am hot on the trail of a way to convert Sun Interleaf
    *  to Macintosh Pict.  I thought I had the problem licked
    *  but have reached another road block.
    *  
    *  I have converted the Interleaf file to PS.  What I mean
    *  by PS (postscript) is I have a file that is pure postscript
    *  code starting with #! Adobe.
That should read something like   %!PS-Adobe
    *  I then FTP'd the file
    *  to the Mac and was able to print the file with programs
    *  like Widgets and Postility.
    *  
    *  Postility also says it can convert EPS (encapsulated postscript)
    *  to Pict or Text.  This did nothing with my PS Interleaf file.
    *  
    *  The question is; what is PS, and what is EPS?  Can one
    *  be converted to the other?  Does anyone know the solution
    *  to my conversion problem.  Thanks in advance for any help.
EPS (Encapsulated PostScript) is more a state of mind than anything
magic.  Briefly, a file claiming to be EPS follows certain well
defined rules to ensure that when it is included into another PostScript
file, it does nothing to disturb the environment of the including
PostScript program.  An EPS file has one important item of
information, namely, a  %%BoundingBox  comment, that is not
necessarily present in a `regular' PostScript program.  A EPS
file can also contain an optional preview section so that an 
including application can display on your screen an approximation
of what the final printed image will look like.

`Converting' PS to EPS would consist of, at a minimum, inserting
a  %%BoundingBox  comment.  One of the best ways to find out
your bounding box, as was well flogged in this forum a few months
ago, is to print the picture and measure it with a ruler.

Note that many applications claiming to emit EPS do so in
ways that will break the including application, or will
fail to print.

    *  
    *  SIDE ISSUE: If I have a PS file from Interleaf, I can 
    *  print it on the sun with the lpr command and I get the 
    *  picture/document (not the PS code).  If I try the 
    *  same file on the mac and print it with a text editor
    *  like Edit, I get the PS code printout, not the 
    *  picture/document (downloading it with Widgets works
    *  fine).  Why the difference?
Chances are some prolog file is missing from the Mac version.
    *  
    *  SECOND SIDE ISSUE:  A Macintosh PS file begins with 
    *  the line #! Adobe 2.0,
I am sure that should be  %!PS-Adobe 2.0
    *  a Sun Interleaf PS file begins with the line #! Adobe.
I am sure that should be  %!PS-Adobe
    *  Does this mean that they are
    *  different versions of PostScript?  The Sun file will
    *  print on the Mac but the Mac file will NOT print on
    *  the Sun. 
I suspect that this is done to work around `deficiciencies'
in the version of TranScript shipped with the Sun system.
If a PS file starts with  %!PS-Adobe 2.0 or whatever, TranScript
may attempt to perform page reversal on the file.  The
version of TranScript shipped with Sun doesn't correctly
handle PostScript programs included inside other PostScript programs.
There's supposed to be a  %%BeginDocument / %%EndDocument
convention to stop the page reversal program from trying to
reverse pages in included documents, but TranScript doesn't
implement this feature, so psrev breaks.

	........  Henry
| Henry McGilton    |                      |                           |
| Sun Microsystems  | I saw the future,    | arpa: hmcgilton@sun.com   |
| 2550 Garcia       |  and it didn't work. | uucp: ...!sun!angel!henry |
| Mountain View, CA |                      |                           |

woody@chinacat.Unicom.COM (Woody Baker @ Eagle Signal) (03/23/90)

Eps information may be obtained from the Adobe file server.  If you'll email
me a message I'll send it to you (the info on how to access it, is included
in the autopost.).  I have a larg 25K information file that answers many
questions.  I'll be happy to send it to anyone who mails me a note.  The
reason for mailing the note, is to provide an automatic return path.
The autoposting answers things that get asked over and over.

Cheers
Woody

derosa@motcid.UUCP (John DeRosa) (03/24/90)

henry@angel.Sun.COM (Henry McGilton--Software Products -- R.I.P.) writes:

>In article <1816@diamond2.UUCP>, derosa@motcid.UUCP (John DeRosa) writes:
>    *  ......code starting with #! Adobe.
>That should read something like   %!PS-Adobe

You are of course correct, working from memory (and being 
PostScript stupid) makes for errors like this.

>    *  SIDE ISSUE: If I have a PS file from Interleaf, I can 
>    *  print it on the sun with the lpr command and I get the 
>    *  picture/document (not the PS code).  If I try the 
>    *  same file on the mac and print it with a text editor
>    *  like Edit, I get the PS code printout, not the 
>    *  picture/document (downloading it with Widgets works
>    *  fine).  Why the difference?
>Chances are some prolog file is missing from the Mac version.

No, that's not it.  To start with, this is a sun document in PS.
I get it to the Mac and can download it to the Laser just fine.
But, if I just try to print it (i.e. using a text editor) I don't
get the real document, I get a listing of the PS code.  It would 
appear that the file is just fine PS, its something in the sending
that causes the laser to ignore the %!PS-Adobe in the first line that
should indicate "here comes postscript code, please draw a picture".
I had heard once that PS must be in a particular font!?  That would
not seem to be the problem, I'm only sending ASCII to the printer.

>I suspect that this is done to work around `deficiciencies'
>in the version of TranScript shipped with the Sun system.
>If a PS file starts with  %!PS-Adobe 2.0 or whatever, TranScript
>may attempt to perform page reversal on the file.  The
>version of TranScript shipped with Sun doesn't correctly
>handle PostScript programs included inside other PostScript programs.
>There's supposed to be a  %%BeginDocument / %%EndDocument
>convention to stop the page reversal program from trying to
>reverse pages in included documents, but TranScript doesn't
>implement this feature, so psrev breaks.

Thanks for the info.

Unfortunately, I still don't know how to convert Interleaf Graphics
to the Mac, I may never find a way.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=    John DeRosa, Motorola, Inc, Cellular Infrastructure Division           =
=                   e-mail: ...uunet!motcid!derosaj                         =
= I do not hold by employer responsible for any information in this message =
=      nor am I responsible for anything my employer may do or say.         =
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

rsilverman@eagle.wesleyan.edu (03/24/90)

In article <1837@diamond2.UUCP>, derosa@motcid.UUCP (John DeRosa) writes:
> 
>>    *  SIDE ISSUE: If I have a PS file from Interleaf, I can 
>>    *  print it on the sun with the lpr command and I get the 
>>    *  picture/document (not the PS code).  If I try the 
>>    *  same file on the mac and print it with a text editor
>>    *  like Edit, I get the PS code printout, not the 
>>    *  picture/document (downloading it with Widgets works
>>    *  fine).  Why the difference?

John,

The reason for this is simple.  The lpr command in UNIX simply ships the data
in the specified file off to the printer (possibly filtered along the way). 
That data is PostScript code, which describes an image -- the interpreter in
the printer got it, interpreted it, and produced your image.

On the Mac, though, you loaded the file into an editor.  The editor brought the
text up onto the screen.  You then asked it to print the file.  It did what
people normally want when they ask for a file to be printed -- caused what you
see on the screen to come out on the printer.  To send explicit PostScript code
to a LaserWriter on AppleTalk, you'll need a utility specifically for doing
that.  Adobe has released a simple one called SendPS into the public domain;
I'm sure there are others.  There are also fancier, interactive programming
utilites, like LaserTalk from Emerald City Software.

                                                Richard Silverman

arpa:	rsilverman@eagle.wesleyan.edu           Systems Engineer
bitnet:	rsilverman@wesleyan.bitnet              AM Computer Products
CIS:	[72727,453]                             Southington, CT 06489

woody@chinacat.Unicom.COM (Woody Baker @ Eagle Signal) (03/26/90)

In article <1837@diamond2.UUCP>, derosa@motcid.UUCP (John DeRosa) writes:
> henry@angel.Sun.COM (Henry McGilton--Software Products -- R.I.P.) writes:
> 
> >In article <1816@diamond2.UUCP>, derosa@motcid.UUCP (John DeRosa) writes:
> >    *  ......code starting with #! Adobe.
> >Chances are some prolog file is missing from the Mac version.
> 
> No, that's not it.  To start with, this is a sun document in PS.
> I get it to the Mac and can download it to the Laser just fine.
> But, if I just try to print it (i.e. using a text editor) I don't
> get the real document, I get a listing of the PS code.  It would 

This is just as it should be.  The text editor is probably using a laser
driver.  On the MAC, I think that if you print a file from an editor, it
goes through a filter that converts it to text.  The fact that you can
download it to the laser and it prints the picture, but you print it from
the editor and get a listing is diagnostic of this.

Cheers
Woody

philip@Kermit.Stanford.EDU (Philip Machanick) (03/27/90)

In article <1115@chinacat.Unicom.COM>, woody@chinacat.Unicom.COM (Woody
Baker @ Eagle Signal) writes:
> In article <1837@diamond2.UUCP>, derosa@motcid.UUCP (John DeRosa) writes:
> > henry@angel.Sun.COM (Henry McGilton--Software Products -- R.I.P.) writes:
> > 
> > >In article <1816@diamond2.UUCP>, derosa@motcid.UUCP (John DeRosa) writes:
> > >    *  ......code starting with #! Adobe.
> > >Chances are some prolog file is missing from the Mac version.
> > 
> > No, that's not it.  To start with, this is a sun document in PS.
> > I get it to the Mac and can download it to the Laser just fine.
> > But, if I just try to print it (i.e. using a text editor) I don't
> > get the real document, I get a listing of the PS code.  It would 
> 
> This is just as it should be.  The text editor is probably using a laser
> driver.  On the MAC, I think that if you print a file from an editor, it
> goes through a filter that converts it to text.  The fact that you can
> download it to the laser and it prints the picture, but you print it from
> the editor and get a listing is diagnostic of this.
> 
Not exactly. It IS text, so you don't have to filter it to text. The difference
is some other operating systems use the first couple of bytes in a file to
determine the file type. The Mac stores file type information somewhere else
(not as part of the "text"). To a Mac program, the file is of type TEXT,
and hence is printed as such. A counter-example: Adobe Illustrator stores its
PostScript in plain text, but the file is tagged as "belonging" to Illustrator.

Philip Machanick
philip@pescadero.stanford.edu