[comp.soft-sys.andrew] ez -> Postscript

nsb@THUMPER.BELLCORE.COM (Nathaniel Borenstein) (08/08/89)

How can I translate a complex ez document to Postscript?  I know it can
be done, because I know that that's how they print.  But I've tried all
sorts of variants and switches using ezprint, ditroff, and the like,
with no luck.  Surely there's some magic incantation I can use that will
allow me to capture the Postscript without sending it to the printer? 
Thanks in advance for your help.  -- Nathaniel

 ----------------------------------------------------------------------

  [An Andrew ToolKit view (a raster image) was included here, but could
                 not be displayed.]Nathaniel Borenstein
                       <nsb@thumper.bellcore.com>

                        Member of Technical Staff
                       Bell Communications Research
   Office: Bellcore Room MRE 2A-274, 445 South Street, Morristown, NJ
                       07960-1910, (201) 829-4270
     Home: 25 Washington Ave., Morristown, NJ 07960, (201) 993-8586

jaap+@ANDREW.CMU.EDU (Jaap Akkerhuis) (08/08/89)

> Excerpts from internet.info-andrew: 8-Aug-89 ez -> Postscript Nathaniel
> Borenstein@thu (742+1)

> How can I translate a complex ez document to Postscript?  I know it can
> be done, because I know that that's how they print.  But I've tried all
> sorts of variants and switches using ezprint, ditroff, and the like,
> with no luck.  Surely there's some magic incantation I can use that will
> allow me to capture the Postscript without sending it to the printer? 
> Thanks in advance for your help.  -- Nathaniel

It is always interesting to see how little people at cmu know about the
way their own programs print
[An Andrew ToolKit view (fnotev) was included here, but could not be
displayed.]. Anyway, here is an overview of how it is supposed to work.

The ATK datastream is converted into a troff input stream. If you use
eq, it is also puts in eqn input, so in that case you have to use that
as well. If you have rasters or zip as well, then this is turned into
PostScript. So the basic idea is that all this mess is send to a
PostScript printer by ezprint. To break down what ezprint does you can
give it the -t option, then it will put the (hybrid) troff stream on
standard output and you can do all the convertions by hand. This is also
useful to see where what goes wrong. If you have printing problems, I
suggest to do the following:

ezprint -t file > file.tr	# This will give you the raw datastream

eqn < file.tr > file.eqn	# eqn at work in case you use eq

Note that depending on the version of eqn you have to give an option
(mostly -Tdevice), that will do some adjustments for the device. Also,
eqn could be called dieqn, could be a shell script (see further) etc.

Now you have a troff input stream, which can have some PostScript
interspersed with it. To get a troff output file (at CMU called .dvi)
you push the stuff through ditroff (or troff or whatever the local
people call it). Note that the new version of troff is assumed, for
dealing with older versions of troff see an earlier note on this subject.

ditroff -Tdevice < file.eqn > file.dvi

Note that the code generated by ezprint assumes that the device name is
psc. If it isn't psc it will suppress the raw PostScript in the input.
You will find in the input stream (file.eqn) things like

.if '\\*(.T'psc' \{\
The Postscript stuff
.\}

So if your ditroff uses an other name to denote a postscript printer,
you need to change the test accordingly. As an alternative, you can dive
into the bowels of the system and link (symbolic) usr/lib/dev{whatever}
to /usr/lib/dev/psc. Then you can still use psc as device name. There is
another caveat, the ditroff you call might actually be a shell script
which performs some ``intelligent'' stuff for you 
[An Andrew ToolKit view (fnotev) was included here, but could not be
displayed.]. One of the things it might do, is always spool your output
to some printer or take the -Tflag and change it into whatever the
operation people choose to call the PostSCript printer. Other scripts
try to figure out what preprocessors you need to run  and are bound to
do the wrong thing. A common flag which these scripts is -t, which
generates troff out put (dvi) on the standard output with ezprint -t |
eqn output. Anyway, try to get your hands on the real troff. Now, after
you ran the real troff, now you have file.dvi, which actually contains
troff output, which might be also have PostScript in it.

Now you have to convert the troff output to PostScript, and now a new
constraint pops up. It is assumed to be converted to PostScript by
psdit, a program from Adobe, part of the TranScript package. If you
don't have this (you have for instance devps), you are in a jam if you
have PostScript (so rasters or zip in the original datastream) since the
way the file.dvi contains the PostScript can only be understood by
psdit. Anyway, to create your final PostScript, one does

psdit < file.dvi > file.psc	# whow, are we happy

Of course, ezprint might do things slightly different (it actually let
lpr run the psdit), but following the above scheme might tell you were
things break. Looking into the various temporary files might also give
you an idea where things break.

As you can see, there is no magic involved, it's all done with smoke an
mirrors.

Enjoy,

	jaap

PS. All this convoluted mess should actually be documented in the next
release notes. I'm not sure whether this will actually happen.

nsb@THUMPER.BELLCORE.COM (Nathaniel Borenstein) (08/09/89)

Thanks for the wonderfully detailed explanation.  It is also worth
noting that three people sent me, as personal mail, "cookbook" formulas
that work for them.  All three were different.  The first I tried worked
fine, and the others probably do as well.  (How do you like that? 
Andrew is so incredibly reliable that almost any printing command will
work, as long as it is long and complex enough...) 

Anyway, sincere thanks to all who responded.  -- Nathaniel

 ----------------------------------------------------------------------
  [An Andrew ToolKit view (a raster image) was included here, but could
not be displayed.] [An Andrew ToolKit view (a raster image) was included
                   here, but could not be displayed.]

           Nathaniel S. Borenstein <nsb@thumper.bellcore.com>
        Member of Technical Staff,  Bell Communications Research
   Office: Bellcore Room MRE 2A-274, 445 South Street, Morristown, NJ
                       07960-1910, (201) 829-4270
     Home: 25 Washington Ave., Morristown, NJ 07960, (201) 993-8586

datri@concave.uucp (Anthony A. Datri) (08/09/89)

=fine, and the others probably do as well.  (How do you like that? 
=Andrew is so incredibly reliable that almost any printing command will
=work, as long as it is long and complex enough...) 

As long as you aren't printing to a Sherpa:-)

Ahhhh, the days of Vice 1....

markf@zurich.ai.mit.edu (10/17/89)

After being just an interested observer of andrew I'm finally able to
actually build and run the thing (thanks to the new beta release which
works on HP workstations). So now I'm vitally interested in many
things on the mailing list which I only casually perused before.

Luckily, I saved your message about converting from ATK datastream to
postscript. In this message you say:

>> Note that the new version of troff is assumed, for
>> dealing with older versions of troff see an earlier note on this 
>> subject.

Well naturally I don't have the new version of troff, I have a version
of ditroff that is at least 2 and 1/2 years old (I do have the
Transcript package.) I also do not have the earlier note that you
refer to. I'm wondering if you (or anyone else on the andrew mailing
list) could send me a copy of that note or explain what my other
printing options are (if I have any).


Mark Friedman
MIT Artificial Intelligence Lab
545 Technology Sq.
Cambridge, Ma. 02139

markf@zurich.ai.mit.edu

jaap+@ANDREW.CMU.EDU (Jaap Akkerhuis) (10/18/89)

> Excerpts from internet.info-andrew: 17-Oct-89 Re: ez -> Postscript
> markf@zurich.ai.mit.edu (1001)

> Well naturally I don't have the new version of troff, I have a version
> of ditroff that is at least 2 and 1/2 years old (I do have the
> Transcript package.) I also do not have the earlier note that you
> refer to. I'm wondering if you (or anyone else on the andrew mailing
> list) could send me a copy of that note or explain what my other
> printing options are (if I have any).


I consider the standard troff as available on V6, V7 etc. as old.
ditroff, DWB and such are new. I will send the earlier note under
separate post. It is not really necessary to clutter the list with it.

	jaap

markf@ZURICH.AI.MIT.EDU (10/20/89)

It seems that every time I try to ezprint something I get something
like the following:

[1] ezprint -t /sw/andrew/help/help.help | ditroff -Tpsc | psdit >/tmp/help.ps 
Starting ezprint (Version Unknown, ATK 12.4); please wait...
Starting ezprint (Version Unknown, ATK 12.4); please wait...
psdit: can't open font table /usr/local/lib/ps/ditroff.font/Times/devpsc/cb.aux
psdit: No such file or directory
Broken pipe  
[2]

It is in fact true that .../Times/devpsc/cb.aux doesn't exist. Well
the big question is: should it exist?  I don't know that much about
ezprint, ditroff or psdit so it's difficult for me to figure this out.
What I do know is that the "cb" is supposed to represent one of the
adobe fonts. Does anyone know which one? It could just be that my
version of transcript doesn't support this font. If that is true am I
just out of luck or is there some way to get one of these programs to
replace the font with some other one.

Any help would be appreciated. Thanks in advance.


Mark Friedman
MIT Artificial Intelligence Lab
545 Technology Sq.
Cambridge, Ma. 02139

markf@zurich.ai.mit.edu