[comp.sys.mac.misc] Interpreting Postscript on Mac || Tools to generate MacDraw file ??

ruud@tnoibbc.UUCP (Ruud) (10/23/90)

I'm looking for a tool for the Mac which enables me to read 
a Postscript file (describing a picture) and interpret it 
in such a way that the initial picture results. 

In know that this is partially possible in MS Word 4.0: MS Word
has the possibility to assign the style Postscript to a text 
containing Postscript instructions. If that particular file 
is then sent to a laserprinter, the Postscript text is 
interpreted and a picture is the result (on paper). 
However, this method has the major disadvantage that I can 
only see the result once it is printed on paper. 

I heard from a possible other solution with Adobe 
Illustrator. Since, we haven't got Adobe Illustrator at our 
department I couldn't try this option (could anyone verify 
this possibility for me). However, knowing a little of the 
functionality of Adobe Illustrator, I assume that importing 
a Postscript picture in Adobe Illustrator has the following 
disadvantage:

If I use Postscript to describe two circles connected by a 
line I'd like to transport my picture in such a way that 
the receiving application (e.g. Adobe Illustrator) still 
sees my picture as two circles and one connecting line (and 
not just one big picture). 

Why do I want this so badly ? My eventual goal is to import 
my picture(s) in MacDrawII. Within MacDrawII I want to be able 
to manipulate the individual objects before I transport the 
picture to, for instance, MS Word. 

A picture in MacDrawII is always treated as a set of user-
defined objects. Therefore, I think that MacDrawII supports 
some kind of macro language to describe the objects of a 
picture (just as PostScript does). I also think that the same 
macro language is used to store the picture in a file. In 
other words, if a MacDraw file is opened, this results 
probably in the interpretation of some kind of program 
written in some kind of language (I think). 

To conclude, I have the following questions for all Mac 
experts:

1. Does anyone know of a tool to interpret Postscript 
   pictures in such a way that I can still manipulate the 
   picture as a set of objects (circles, lines, etc.) ?

2. Does anyone know the technical specifications of a 
   MacDraw file ? Is a macro language used to describe the 
   different objects of a MacDraw picture and, if so, how does 
   this macro language look like ?

3. Are there any tools available (public or commercial) to 
   interpret or generate a MacDraw file (except for MacDraw 
   itself, ofcourse) ? I'm thinking of a programming language 
   or whatsoever. 

If you have any idea, additional questions or remarks 
concerning the questions above, please respond by e-mail.

Thanks in advance, Ruud.


================================================================================
Ruud van Mieghem : TNO - BOUW              INTERNET : ruud@tnoibbc
                 : PO-box 49               DOMAIN   : ruud@ibbc.tno.nl
                 : 2600 AA  Delft          FAX      : +31 15 843990
                 : the Netherlands         VOICE    : +31 15 842039
================================================================================

shiva@well.sf.ca.us (Kenneth Porter) (11/06/90)

Your description of MacDraw suggests that it is a descriptive
graphic format.  PostScript is a procedural language, like C
and Forth. Imagine what would be involved in converting a C
program to a MacDraw file.  Even a C or Forth program that
consisted mostly of drawing primitives would be quite difficult
to parse and convert.  The models are just too different.
 
This is a general problem associated with converting PostScript
to other graphics formats.  Because PostScript is procedural,
the graphics operators are normally embedded within quite a bit
of control structure (loops and conditionals).  Unless the
PostScript source restricts itself to a well-defined set of
operators, it is essentially impossible to convert the source
to an object description. 
 
Illustrator can parse PostScript files and recover objects
provided that the PostScript uses a specific set of procedures
defined in Illustrator's prolog (see the Illustrator file
format document available from ps-file-server@adobe.com). 
These procedures are designed to represent objects.  An
Illustrator object is represented by a call to a procedure with
appropriate parameters.
 
If your PostScript file was generated mechanically by an
application, it's possible that it uses a prolog to encapsulate
the application's object descriptions into PostScript
procedures (as Illustrator does). If this is the case, your
parsing job gets considerably easier because you just have to
parse the application's pseudo-object-language (ie. the
PostScript script containing calls to the application's object
procedures).
 
If what you want is PostScript to raster, you should use
Ghostscript or one of the commercial host-based PostScript
clones like Go-Script or Freedom of Press.
 
Ken (shiva@well.sf.ca.us)