[comp.lang.postscript] help printing MAC postscript files

cew@mtuxo.att.com (XMP14-C.WALKER) (01/14/89)

Help!

Does anybody know how to print out a MAC postscript file on a laser
printer that is attached to a UNIX machine?

I have generated a postscript file on the MAC using a command-k from
the PRINT window and up-loaded the file to my UNIX machine via the
XMODEM text file transfer program.  When I send the file to my postscript
printer (a QMS-PS 800 II) from the UNIX machine, nothing comes out.
Is there something special that I have to do to the MAC file to print it
on a general postscript printer (it has what seems to be the MAC
postscript header that defines a number of postscript routines)?

I have used UNIX-based packages to generate postscript files and have
been successful in printing them on the QMS, so there must be
something unique about the MAC file.  It was generated on a MAC SE
attached to a Apple LaserWriter II and using the NT/NXT icons and
laserprep files.

I have even generated and up-loaded the file several times to make sure
it isn't a transmission error with no luck.  I'm not sure what to try next.

If you have solved this or a similar problem, please let me know by
e-mail.

Thanks,

Carl Walker

bezanson@adobe.COM (Brian Bezanson) (01/17/89)

When you take a file generated by a command-F or command-K in the print dialog,
it will produce proper postscript code for your application, but the command-F
version doesn't include Apple's dictionaries, and the command-K version
sometimes isn't too clean. So how do you print those files? My suggestion, based
on what has always worked for me, is to use several different applications to
do a command-K file of a very simple document (i.e. one word in MacWrite, one
line in MacDraw, etc...) Then edit the files to remove the application specfic
code. What you are left with are several copies of the LaserPrep prolog. Compare
these files against each other. If they all seem to be identical, then I'd
assume you have a good copy of the header. Then send this to your Unix machine,
and prepend it to each command-F Mac file you send. Technically you should only
need to download this dictionary/header info once to the laserprinter, but I'd
suggest for the few extra seconds to send it in case someone has purged/reset
the laserprinters memory.

Hope this helps. If you have any problems with the above techniques, send me
some email and I'll compile a list of areas people have problems in. I'd like
to work with someone at Apple and create the definitive guide of bringing your
Mac/Apple LaserPrep generated files to other machines for downloading to 
PostScript(tm) printers.

Good luck.
------------------------------------
Brian Bezanson
Adobe Systems Inc.
bezanson@adobe.com

stone@hydra.unm.edu (Andrew Stone CS.DEPT) (01/17/89)

In article <219@adobe.COM> bezanson@adobe.UUCP (Brian Bezanson) writes:
>When you take a file generated by a command-F or command-K in the print dialog,
	[Great Advice Follows]

If you are running Multifinder, be sure to turn off Background Printing in the
chooser, otherwise no files will be generated.


||<<++>>||<<-->>||<<==>>||<<++>>||<<??>>||<<++>>||<<-->>||<<==>>||<<++>>||
||                                  ||                                  ||
||	   Andrew Stone	            ??		2 + 2 = 5;		|| 
||         stone@hydra.unm.edu	    <> 	    for sufficiently large 2    ||
||	   			    ||					||
||<<++>>||<<-->>||<<==>>||<<++>>||<<??>>||<<++>>||<<-->>||<<==>>||<<++>>||

"Back where I come from we have Universities, great seats of learning, where
men go to become great thinkers, and when they come out,they think deep thoughts
and with no more brains than you have, but they have one thing you haven't got:
a diploma"  -- Wizard of Oz

sbb@esquire.UUCP (Stephen B. Baumgarten) (01/18/89)

In article <219@adobe.COM> bezanson@adobe.UUCP (Brian Bezanson) writes:
>Hope this helps. If you have any problems with the above techniques, send me
>some email and I'll compile a list of areas people have problems in. I'd like
>to work with someone at Apple and create the definitive guide of bringing your
>Mac/Apple LaserPrep generated files to other machines for downloading to 
>PostScript(tm) printers.
>
>Good luck.
>------------------------------------
>Brian Bezanson
>Adobe Systems Inc.
>bezanson@adobe.com

I wish someone at Adobe would hit the people at Apple over the head.
Why should this stuff remain so undocumented?  There's so much
misinformation going around about how to print PS files from the Mac
that you'd think someone at Apple would clean things up once and for
all.

Worst of all, once you finally get a LaserPrep header file, you *still*
can't just send it to a PS printer.  You have to munge around with it
some.  What a pain.

And as a previous poster noted, the result is not at all suitable for
inclusion in other documents, since Apple uses absolute addressing.
Feh.

Clean this stuff up, Apple.  For a company so concerned with
"connectivity" of late, this really borders on the shameful.  No one is
asking you to dump QuickDraw for Display Postscript, but it would be
nice if the Postscript you *did* generate was useable on a
non-Macintosh system.

And to anyone who wants the "prepfix" package which does the munging
for you, let me know.  It was also posted to comp.binaries.mac
recently, so you might be able to get it from an archive site as well.

-- 
   Steve Baumgarten             | "New York... when civilization falls apart,
   Davis Polk & Wardwell        |  remember, we were way ahead of you."
   cmcl2!esquire!sbb            | 
   esquire!sbb@cmcl2.nyu.edu    |                           - David Letterman

rob@ccsrd11.UUCP (Robert Sleator) (01/18/89)

The LaserPrep file (the PostScript prolog prepended to most Mac files sent
to the LaserWriter) contains code which is more or less equivalent to:

	statusdict /product get		% returns string with product name

	<< is this equal to the string (LaserWriter) (e.g., are you a LaserWriter ?) >>

	{eexec}{flushfile} ifelse	% if LW do eexec, else do flushfile
		.
		.
		.
	<< a bunch of hex >>
		.
		.
		.
	%%EOF

	<< begining of script part of file, which contains your text >>

The problem is that when you save this file with Command-K there is no ^D next to
the %%EOF comment.  If you then run the file on a printer other than a LaserWriter
it executes the flushfile rather than eexec, and flushes to the end of the job.
The solution is to edit the file and insert a control-D next to the %%EOF comment
(and make sure that the "exitserver" line is not commented out). 

Alternatively, if you don't want the prolog downloaded permanently, you can comment
out the exitserver line and delete everything from the first line that resembles this:

	currentfile ok userdict /smooth known not and{eexec}{flushfile}ifelse

down to the %%EOF line.  This should be mostly hex.

NOTE: The above applies to version of the LaserPrep file before version 67.  Version
67 may not have this problem.  It does contain a couple of new examples of 
non-portable code, though.

liam@cs.qmc.ac.uk (William Roberts) (01/18/89)

There are a lot of problems here, most of which stem from the
"I own the world" attitude expressed in the Macintosh software
and some from the assumption that everyone is connected to
their printers via AppleTalk.

First things to do include

1) strip out the line in the header which mentions setdefaulttimeout
2) remove the line that begins with ok, since this will do
   stupid things to the comms hardware in the LW that you don't want.

A bit harder - perhaps a small C program

3) Convert all characters with bit 7 set to be \213 or whatever
   using the PostSCript excape convention for octal characters

This one is unavoidable

4) Don't generate any output containing bitmaps in binary form

The reason for 4) is that a simple serial line connection
requires embedded control information with the data, whereas an
AppleTalk connection uses a packet protocol and clearly
separates control information from data. Your binary data is
bound to contain junk like ctrl-D and ctrl-T which are ALWAYS,
ALWAYS, ALWAYS treated as control information when talking to a
LaserWRiter through the 25 way connector.  Classic ways to fall
foul of 4) include

 * selecting "Faster Bitmap Printing" on the standard Page Setup
 * using Aldus FreeHand
 * using Pagemaker 3.0 with any driver except Linotronic 100/300

and those are just the ones I've had problems with in the last
week.

Oh yes, you will probably need to stuff the file through fold,
because it contains a few lines of over 2000 characters -
fortunately these are all hex data, so extra linefeeds are
ignored (bitmaps should be done this way).


You will find it useful download the Adobe ehandler.ps routine
before you start, just in case you find other garbage that I've
forgotten. Why are LaserPrep files always written by people
with no love for (or understanding of) PostScript?
-- 

William Roberts         ARPA: liam@cs.qmc.ac.uk  (gw: cs.ucl.edu)
Queen Mary College      UUCP: liam@qmc-cs.UUCP
LONDON, UK              Tel:  01-975 5250