[comp.sys.mac.misc] Printing to a file or a serial port.

roskar@jhunix.HCF.JHU.EDU (Veljko Roskar) (09/11/90)

In article <10085.26eb73c4@amherst.bitnet> ksbolduan@amherst.bitnet writes:
>I have a hacked version of the LW driver if anyone wants it. You simply select
>it from the Chooser and when you "Print" it creates the Postscript file. It may

......
Here is two different ways to adjust the LW files to print to a file or, in 
the suggested way, to a serialport.  You have to make sure you have the same
version of Laserprep and LW driver as the machine you will be printing from, 
otherwise this won't work.


===+==+++==+++==++=+++++++++==++=++++==+=++==+==+++=====+++++++=++=++=++===
Info-Mac Digest             Thu,  1 Feb 90       Volume 8 : Issue  20 

Date: Mon, 29 Jan 90 13:47:40 PST
From: Ray_Davison@cc.sfu.ca
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 (version 5.2)
 
  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
 
             location   from      to
             --------   ----      --
              B96       '57C0'   '51C0'
              B9A       '56C0'   '50C0'
              BA2       '57C0'   '50C0'
              BAA       '57C1'   '51C1'
              BB8       '57C1'   '50C1'
       if you need the Laser Prep file (as for a serial connected printer)
       then you must simulate command-K (note: I haven't tried this). Do
       the changes above except:
              BA2       '57C0'   '51C0' 
              BAA       '57C1'   '50C1'
              
     - the following two changes prevent the creating of a file and the
       subsequent call to _SetEOF to empty it:
          resource PDEF number 125
          
             location   from       to
             --------   ----       --
              D96       '554F'   '6038'
             142C       '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.
 
  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).
 
I hope someone finds this useful.

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




Info-Mac Digest             Tue,  6 Feb 90       Volume 8 : Issue  24

Date: Sun, 4 Feb 90 00:12:26 PST
From: Ray_Davison@cc.sfu.ca
Subject: More on serial line LaserWriter
     
A few issues back in Info-Mac, I gave a description of turning the
LaserWriter driver into a serial port PostScript driver. Since then
I have received a couple of messages, mostly asking for similar
updates for the version 6.0 driver (are you people never satisfied :-)
I also recieved a hint on doing one thing differently (see below).
     
In light of that, I have applied the updates to version 6.0 of the
driver, and present the new formula below:
     
     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 Laser Prep)
         BAA    C8C       '57C1'    '51C1'   ('50C1' for Laser Prep)
         BB8    C9A       '57C1'    '50C1'
       (the hint on doing this part differently was to modify resource
        DITL number -8191 to make the "Disk File" box visible. The
        problem I had with this is that the box doesn't stay "ticked"
        between uses of the driver, so you have to retick the box each
        time. This didn't do me much good since I always want to send
        the print job to the serial port. If I am missing something, I
        hope someone will let me know.)
     
       (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)
            location          From        To
          v5.2    v6.0
          142C    1860       '660C'      '600C'
     
     Resource STR number -8191
        Change this from "PostScript" to ".BOut" for the printer port,
        or ".AOut" for the modem port.
     
     Resource STR number -8159
        Change to a useful message instead of "Creating PostScript File".
        For example "Sending print job to Unix".
     
     Resource PAPA number -8192
        Change the name of the printer if you want to.
     
  Ray Davison
  Simon Fraser University
  Ray_Davison@cc.sfu.ca

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

The easiest way to do it is to get MyPageSetup from sumex, which
can, among other useful things, put a check box in the Print dialog.
That way you don't have another init to run.

Mind that you have to have the LW selected in the chooser. 
You can then turn off AppleTalk. 

Good Luck.


-- 
Veljko Roskar                            | roskar@jhuvms.bitnet
Department of Chemical Engineering       | roskar@jhuvms.hcf.jhu.edu  
The Johns Hopkins University, Baltimore  | uunet!mimsy!aplcen!jhunix!roskar