Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sgi!key!perry From: perry@key.COM (Peter Kiehtreiber) Newsgroups: comp.sys.mac.programmer Subject: Re: Mac PS Printouts via Sun Unix Keywords: mac ps sun unix printing Message-ID: <377@key.COM> Date: 3 Mar 89 00:14:04 GMT References: Reply-To: perry@arkon.key.COM (Perry The Cynic) Distribution: na Organization: Key Computer Laboratories, Fremont Lines: 70 [If you aren't interested in printing Mac PostScript files under UNIX, you can hit 'n' now.] In article aberg@math.rutgers.edu (Hans Aberg) writes: > The old Sun UNIX system used to have a Mac PostScript printout filter > [ lpr -M ], but the new OS doesn't. > Now, one would expect any PS file print on any PS printer (with the > usual exceptions, custom PS commands etc.) > Does anybody know why this filter is needed? What is the difference > between the Mac PS files, and other PS files. (Regular PS files do > print out. The Mac files are created using cmd-F; the cmd-K produces > a prep directory, that wedges the printer.) > Hans Aberg, Mathematics > aberg@math.rutgers.edu I don't know of (or remember) a "-M" option to lpr. Was it really a Mac-specific option, or just "generic PostScript"? If it was, it probably did what I describe below. The reason why the output of cmd-K "wedges" the printer is that the Apple LaserPrep file tries to do rather intrusive things to the printer. (I think it actually tries to download MC68000 code to the printer engine, but don't quote me on that. In any case it tries to make permanent modifications in the LaserWriter's memory, a definite no-no in a shared environment). The TranScript system, being in a multi-user environment, "locks" the printer against such blatant intrusions. If you check the spool directory for your printer (/usr/spool/), you'll find an error message in the log file (lw-log), usually "InvalidAccess"; the printer then proceeds to ignore your job. On the other hand, a file produced by cmd-F relies on the LaserPrep file having been sent to the printer before, so this won't work either. So what's a user to do? What I do (Sun 3/280, SunOS3.5, LaserWriter II NT), is use a modified LaserPrep file. I keep that file here on the Sun, and pre-prend it to any PostScript output I want to print (produced with cmd-F). To be exact: #!/bin/sh LASERPREP=/whereever/you/keep/the/modified/copy/of/LaserPrep (cat $LASERPREP $*) | lpr -P Well, you get the picture. The change to the LaserPrep file isn't all that bad. It mainly consists of deleting the offending commands at the start of the file, and verifying that it still works afterwards. A simple trial-and-error job. For your convenience, here's a diff beween the original (System 6.0.2/3) and my version: 1d0 < %! 8a8,14 > statusdict begin waittimeout 300 lt{0 60 300 setdefaulttimeouts}if end > currentfile statusdict begin serverdict begin product (LaserWriter II NT) eq revision 1 eq and {/setrealdevice {//setrealdevice exec 31 sendpcmd 4 eq tonerlight} bind def > /execjob {31 sendpcmd 4 eq tonerlight //execjob exec} bind def end end eexec}{end end 722{currentfile read pop pop}repeat}ifelse > 35de8eabfc7fa... > d27489a69d6b6... (long lines truncated here) > 7b1c0b5203cfc... > 6eb9e36ec45ba... 17a24 > ok{statusdict begin 9 sccinteractive 3 ne exch 0 ne or{9 0 3 setsccinteractive}if end}if In clear text: delete lines 8-14 and 24, and add "%!" as the first line. (You should visually inspect your LaserPrep file to make sure your file matches the contents shown.) I hope this helps. Works without a hitch for me, anyway. Have fun! -- perry -- ------------------------------------------------------------------------ Perry The Cynic (Peter Kiehtreiber) perry@arkon.key.com ** What good signature isn't taken yet? ** ...!pacbell!key!perry