[comp.sys.mac.misc] PostScript to parallel/serial port instead of to a file?

quang@CSUFRES.CSUFRESNO.EDU (Quang Ngo) (05/08/91)

I like to know how to use ResEdit (or something familiar) to edit
LaserWriter 6.1 (yes, 6.1) so that it would send the PostScript file
(by clicking on the PostScript option) to the parallel/serial port instead
of dumping it to a file.  Someone has done this already?

Here's the article on how they did it for the earlier versions.  The article
is quite long.  I marked the related paragraph with 'XXXX' below.  Search
XXXX to get there fast.

-Quang (quang@csufres.CSUFresno.EDU)
 
ps.  LaserWriter 6.1 is @apple.com
     /pub/dts/sw.license/607i-printing-tools.hqx

Please e-mail me.

----

Path: ux.acs.umn.edu!cs.umn.edu!spool.mu.edu!mips!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!shlump.nac.dec.com!sousa.enet.dec.com!bombe.enet.dec.com!moore
From: moore@bombe.enet.dec.com (W. Bruce Moore)
Newsgroups: comp.sys.amiga.emulations
Subject: Re: Printing from AMAX
Message-ID: <1061@sousa.enet.dec.com>
Date: 9 Apr 91 23:48:29 GMT
References: <50086@nigel.ee.udel.edu>
Sender: newsa@sousa.enet.dec.com
Reply-To: moore@bombe.enet.dec.com (W. Bruce Moore)
Organization: Digital Equipment Corporation, Littleton MA
Lines: 330

You probably need to modify Laser Prep to work on non-Apple laser printers.

Here are some useful tips to try...

Date: Thu, 8 Nov 90 21:09:12 -0600
From: Don Gillies <gillies@cs.uiuc.edu>
Subject: Generating Postscript

Here is "Everything you ever wanted to know about generating and printing
postscript on the macintosh."  The only change to this edition is:

-> Tells how to patch Laserwriter 6.0 so that the
   "black/white" button is turned ON by default.

---------------------------- cut here ------------------------------------
The following information is condensed from earlier messages in
"generating-postscript.txt" and other sources.  Here are some of the
contributers:
gillies@cs.uiuc.edu
Ray_Davison@cc.sfu.ca 
jhl%naif.span@vlsi.jpl.nasa.gov (Jay Lieske)
dmg@mitre.mitre.org
Les_Ferch@mtsg.ubc.ca
Russ Evans <E_GS18%vaxa.nerc-murchison.ac.uk@nsfnet-relay.ac.uk>
The Blue Adept <KSBOLDUAN%AMHERST.BITNET@cunyvm.cuny.edu>

-----------------  How to generate a postscript file ---------------

(1) THE ONETIME POSTSCRIPT GENERATOR

This is a fast way for people who generate postscript twice a year,
and are afraid of Apple's ResEdit resource-editing program.

Select "Chooser" from the Apple menu, and then tell it you have
appletalk hooked up (lie).  If you really are using appletalk, then
you will have problems if there is no laserwriter on the network.  In
this case, perhaps you will be forced to disconnect appletalk.

Select the LaserWriter (not the LaserWriter SC driver.)  Turn
Background Printing (PrintMonitor) off if you are using MultiFinder.
YOU CANNOT GENERATE POSTSCRIPT IF IT IS ON!  Select the LaseWriter
This will cause small formatting changes in most word processors,
since the laserwriter has larger characters than the Imagewriter or
other printers.  The changes can easily ruin a well-formatted resume.
Go to your word processor and correct the lines that have now changed.
It is a good idea to leave the laserwriter selected all the time, if
possible, so your documents are created with these changes already in
place.

Get ready to print the document in the normal fashion.  When you see
the LaserWriter dialog, click on OK and immediately type and hold
either the "k" key or the "f" key. You must depress the key immediately
within the first 1-2 seconds AFTER the dialog disappears.  Do not use
command-F or command-K, as there might be problems in depressing the
key too soon after clicking OK on the dialog.  

If you get a message "looking for laserwriter", then you probably hit
the key too late.  In that case, try again; when the print dialog
comes up instead of clicking on the OK button, HOLD THE MOUSE DOWN
without releasing it.  Then at your leisure press the "f" or "k" key
and then FINALLY release the mouse.

You should see a file called Postscript0 appear in the current folder.
The next time you do it, if Postscript0 already exists, Postscript1
will be generated, etc.  When Postscript9 is generated, no further
files will be generated.

The difference between these commands is that "k" prepends the
contents of Laser Prep to your Postscript output; "f" does not.  

(2) THE WEEKEND POSTSCRIPT GENERATOR

This is for people who want to occasionally generate postscript, but
also want to occasionally print directly to an attached serial or
appletalk laserwriter.

We suggest you add "Disk File" box in the laserwriter dialogue.  It
turns out that every laserwriter icon since version 5.2 (v5.2) can
have this option [Yes, Dorothy, you can go back to Kansas].  One way
to accomplish this is to employ the MyPageSetup utility, available as:
[sumex-aim.stanford.edu]<info-mac>util>mypagesetup13.hqx

Another way to accomplish this is via ResEdit:

    (a) Make a copy of the Laserwriter icon to fiddle with.

    (b) Using the latest version of ResEdit (v1.2 or later), open the copy
and then open DITL #-8191.  Choose "Select Item Number" from the DITL
menu, and enter number 22.  Close the Window and then choose "Open As
Dialogue Item" from the File menu.  This should open a window
describing a "Disk File" item, which has a bounding box of
((0,0)(0,0)).  This box is all zeroes, which is why the "Disk File"
checkbox is invisible.  Change it to something useful
((49,314)(65,395)) and close the window.  The word "Disk File" should
now appear in the dialogue box.  Drag it elsewhere to change
the positioning.  Close ResEdit and save your changes.

Now, every time you print, you may select the checkbox in order to
generate a "Postscript0", "Postscript1", ... etc. file.  Yet ANOTHER
way to accomplish this is by using an INIT that lets you name the
Postscript file differently, every time you print:
[sumex-aim.stanford.edu]<info-mac>util>laser-fix-10.hqx

(3) THE USER WITH NO LASERWRITER AT ALL

This is for people who never have access to a laserwriter directly
from their macintosh.  For instance, people who only generate
postscript to send to a service bureau, or who always want to upload
the postscript to a remote machine.  

It turns out the "Disk File" box will not stay ticked (so far as we
know), so we suggest you patch the laserwriter driver to ALWAYS
generate a postscript file.  Begin by making a spare copy of your
"Laserwriter" icon (because you can easily damage it permanently).
Then use ResEdit to make the following patches to the copy (note: you
will be editing a string of hex digits; do not change the length of
the string).

     Resource PDEF number 125
           location           From       To
Laserwriter  v5.0   v5.2   v6.0
     B5C    B96    C78       '57C0'    '51C0'
     B60    B9A    C7C       '56C0'    '50C0'
     B68    BA2    C84       '57C0'    '50C0'   ('51C0' for Laser Prep)
     B70    BAA    C8C       '57C1'    '51C1'   ('50C1' for Laser Prep)
     B7E    BB8    C9A       '57C1'    '50C1'

Close ResEdit and save your changes.  Now, when printing, if you
select "OK" in the dialogue, a Postscript file will always be generated.

(4) THE USER WITH A DEDICATED COMPUTER + PRINTER ON HIS/HER SERIAL PORT.

This is for someone who has a workstation or mainframe listening to
the macintosh serial port.  This workstation or mainframe is connected
to a postscript printer.  The workstation or mainframe is running a
program ready to accept a postscript file and spool it to the printer.

===+==+++==+++==++=+++++++++==++=++++==+=++==+==+++=====+++++++=++=++=++===

XXXX

Subject: Serial line LaserWriter

Awhile ago someone had a request for information on connecting a LaserWriter
to the serial port through a switch box. I had a similar need. I have a Mac
and a Unix box and wanted to use the printer on the Unix box from the Mac.
I didn't want to spend the money for a Kinetics box for just one Mac so I
went the route of using command-F to create a file, moving the file to Unix
and using macps to print the file. This was rather tedious.
 
I modified the LaserWriter driver as outlined below. The changes I made
were specifically designed to print over a serial connection from the Mac
to the Unix box, but may be useful to print to a serial connected LaserWriter.
 
Changes to the LaserWriter driver (versions 5.2 and 6.0)
 
  1) Duplicate the file and give it a useful name.
  2) Use ResEdit (or something similar) to make the following changes:
     - to simulate the pressing of command-F
 
     Resource PDEF number 125
       (first always write to a "file")
           location       From       To
         v5.2   v6.0
         B96    C78       '57C0'    '51C0'
         B9A    C7C       '56C0'    '50C0'
         BA2    C84       '57C0'    '50C0'   ('51C0' for no Laser Prep)
         BAA    C8C       '57C1'    '51C1'   ('50C1' for no Laser Prep)
         BB8    C9A       '57C1'    '50C1'
          
       (next don't create a file (still in resource PDEF/125))
            location          From         To
          v5.2    v6.0    V5.2    V6.0
          D96     E9E    '554F'  '558F'   '6038'
     
       (next, don't do _SetEOF to empty said file)
            location          From        To
          v5.2    v6.0
          142C    1860       '660C'      '600C'
     
     - change the string in resource STR number -8159 to something more
       useful than "Creating PostScript File" (e.g. I used "Sending print
       job to NeXT").
 
     - set resource STR number -8191 to the name of the serial port you
       will use. ".BOut" for the printer port or ".AOut" for the modem port.
 
     - set resource PAPA number -8192 to the name of the printer if
        you want to.

  A couple of notes: the default settings for the serial ports are 9600 baud
  no parity. So far this has worked fine but I may try changing the speed.
  When you choose the driver with the Chooser, it will turn on AppleTalk. If
  you are using the printer port then you *must* turn AppleTalk back off
  before using the modified driver.
 

  On the Unix end: I modified macps to "break" instead of "continue" when
  it finds the string "%%EOF" and then the command
       macps < /dev/ttyb | lpr
  can be installed in a deamon that loops forever (modify /dev/ttyb to use
  whatever serial port on your Unix box you connected the Mac to).
 
==+===+=====++++++++++======++++++==+====+==++===++==+++====+===++++=+++==


----------------------- OTHER USEFUL INFORMATION -------------------------

(1) FORCING THE GENERATED FILE TO GO TO ONE DIRECTORY

Postscript files are normally stored in the folder of the application
that is currently running; If you have a telecom script (Red Ryder...)
that uploads your Postscript file, it may not find this file.  We
suggest you make the file go to a pre-specified folder on your hard
disk.  Edit you Laserwriter icon via ResEdit as follows:

     Resource STR #-8191
FromTo

"Postscript""HD40:Postscript"

This would put the file in the top-level directory of a hard disk
named "HD40".  Or if you just want all your files to go into a folder
named "Spool" on a disk named "HD40":

     Resource STR #-8191
FromTo

"Postscript""HD40:Spool:Postscript"

etc. etc. etc.

(2) WHAT TO DO WHEN YOU HAVE PROBLEMS PRINTING THE FILE ON A
NON-LASERWRITER

Apple's laserprep file crashes nearly all non-apple printers (Not
cool, apple).  Because of copyright law and lawyers, we can't just
give you a modified laser prep file.  Instead, we offer two ways to
get around this problem.  One, you can use a UNIX program ("prepfix")
that edits a laserprep file to fix the mistake.  Two, you could edit
the file yourself (it takes 5 minutes and a decent editing program).

METHOD 1.  These UNIX programs will (a) edit a Laserprep file for you,
and (b) concatenate an edited Laserprep file with a postscript file;
These programs are stored in
[sumex-aim.stanford.edu]<info-mac>unix>macps-22.shar

This is a shar archive containing two programs.  The shar archive is
unpacked using the Bourne shell and provides various documentation and
build files as well as the two c programs -- prepfix and macps.  The
first processes the LaserPrep file produced by holding down <Apple+K>
whilst printing an empty file and transforms it into a prep file which
is acceptable to most Postscript printers.  The second, macps,
processes documents produced using the <Apple+F> key to include the
processed header file.  prepfix/macps allow for the possibility of
different versions of Apple's LaserPrep.  

METHOD 2.  Read the file 
[sumex-aim.stanford.edu]<info-mac>tips>imagen-postscript.txt

This file tells you how to edit a laserprep file to work with most
printers (this isn't just for imagen printers, actually).  Note: Only
Apple printers have bitmap smoothing; this is not part of normal
postscript.  If you absolutely need bitmap smoothing, and your printer
has an MC68000-family processor, and you are using the laserwriter
v5.2 icon, consider downloading the following specially hand-modified
laserprep file:
[sumex-aim.stanford.edu]<info-mac>misc>laserprep-65-postscript.txt.

This file SHOULD NOT be used with non-MC68000 printers; it contains
assembly-language code that could crash such printers.  

(3) YOU HAVE A POSTSCRIPT FILE ON YOUR MACINTOSH AND WANT TO GET IT TO
THE PRINTER --

A Postscript(R) file can be printed using three utilities: SendPS, a
free application from Adobe, archived in
[sumex-aim.stanford.edu]<info-mac>util>sendps-121.hqx

Or use PS Printer, a free desk accessory; or Hyper PS, a Hypercard
stack for sending Postscript files to a Postscript printer.

(4) YOU WANT THE LASERWRITER 6.0 DRIVER TO GENERATE BLACK/WHITE BY DEFAULT
 
Here's a LaserWriter 6.0.x tip you may want to pass on. Paul Cozza (author of
SAM anti-virus utilities) came up with a patch to the LaserWriter color driver
to set B/W as the default rather than color. This speeds up most printing and I
can personally attest for the reliability with both 6.0, 6.0.1 & 6.0.2.
 
Using ResEdit open the LaserWriter 6.0 icon.  Make the following changes:
 
     Resource PDEF number 4
           location       From       To
    18F3  0017    0018

If you have a sector editor such as "Fedit" or "Copy II Mac", search
for the string   "377C 0017 0004 7801" 
and change it to "377C 0018 0004 7801".
(Block 141 Part A via Copy II Mac)
 
This will change the radio button default to B&W.



--
    W. Bruce Moore
    Moore@bombe.pa.dec.com