Date: Sat, 27 Jun 92 04:06:03 -0500 From: Don Gillies Subject: new version of generating-postscript.txt please delete the first three lines of this email message and put the rest in the archive. this new version belongs on [sumex-aim.stanford.edu]/info-mac/tips/generating-postscript.txt. ----------------------------- cut here ----------------------------- This file is called "generating-postscript.txt" and lives on the computer [sumex-aim.stanford.edu] in the /info-mac/tips/ directory. last update was 6.25.92. DIRECTORY Generating Postscript (0) The laserwriter 7.0 way is easy (1) The onetime postscript generator [with keypress] (5.x, 6.x) (2) The weekend postscript generator [with checkbox] (5.x, 6.x) (3) The user with no laserwriter at all [with asm patch] (5.x - 7.x) (4) The user with a dedicated computer listening to the serial port (5.2/6.0) Appendix (A.1) Forcing the postscript file to go to one directory (A.2) Printing the file on a non-apple laser printer(pre system-7) (A.3) Downloading a postscript file to an attached laser printer (A.4) Making laserwriter 6.x driver generate black/white by default (A.5) Getting laserwriter 5.2 to coexist with 6.1 and 7.0 (A.6) Making the laserwriter driver relinquish the appletalk port (A.7) Changing the defaults in the laserwriter dialogue (A.8) Avoiding HUGE font files with the 7.0 print driver A great deal of technical information on the system 7.0 laserwriter driver can be found in the file [sumex-aim.stanford.edu] /util/dmm-laserwriter-stuff-11.hqx. This file is nearly 3 years old. If you have specific questions about any of the procedures in this file, please try to refer the questions to the authors (or to me, if the author is not mentioned). Please send me any new patches or corrections that you may find. Thanks. - don gillies (gillies@cs.uiuc.edu) ---------------------list of contributors ---------------------------- gillies@cs.uiuc.edu (moderator) 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 The Blue Adept Rob Tevor - background printing w/checkbox Brian Mathews - making driver relinquish appletalk port Lawrence D'Oliveiro - making laserpreps live in harmony Ian Harries - setting laser prep defaults Mark Wang - shortening 7.0 postscript files. Axello de Roestello - shortening 7.0 postscript files. ----------------- How to generate a postscript file --------------- (0) THE LASERWRITER 7.0 WAY IS EASY In system 7.0, it is easy to generate a postscript file. Simply click on the "disk file" box in the laserwriter dialogue. The next four procedures describe what to do with earlier versions of the laserwriter driver. (1) THE ONETIME POSTSCRIPT GENERATOR (PRE-SYSTEM 7.0 LASERWRITER DRIVER) 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" check 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]. The system 7.0 laserwriter driver has this checkbox STANDARD. One way to add this box 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. Another way to add the box is to employ the MyPageSetup utility, available as: [sumex-aim.stanford.edu]util>mypagesetup13.hqx 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]util>laser-fix-10.hqx This method has an advantage, according to robt@mummy.agsm.unsw.oz.au (Rob Trevor). You can print in the background (at least under system 6.0.3) if you use this method. So you can leave the backgrounder turned on, and the file will always go into the background folder. (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. System 5.x, 6.x drivers - 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. System 7.x drivers - Here's a hack to make the PostScript File radio button the default, instead of the Printer radio button. The usual caveats apply: do this to a copy of your LaserWriter file, and don't blame me if your Mac blows up because of this. It works for me, your mileage may vary... Anyway, the hack: 1. Fire up ResEdit, and open the LaserWriter file in the Extensions folder in your System folder. 2. Open the PDEF resources. 3. Open resource ID 4. 4. Do a Find Offset... and enter 195E. The word before the offset should be 377C, and the word at the offset should be 001A. 5. Change the 001A to a 001B. 6. Close the PDEF ID = 4 from LaserWriter window. 7. Close the PDEFs from LaserWriter window. 8. Open the DITL resources. 9. Open resource ID -8191. 10. Double click on the Print button in the upper right corner. 11. Change the button's text to Save. 12. Choose Quit, or close all of the windows, saving changes. That does it. -- Brian L. Matthews blm@6sceng.UUCP (4) THE USER WITH A DEDICATED COMPUTER LISTENING TO THE 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. ===+==+++==+++==++=+++++++++==++=++++==+=++==+==+++=====+++++++=++=++=++=== 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 (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). ==+===+=====++++++++++======++++++==+====+==++===++==+++====+===++++=+++== -------------------------------------------------------------------------- -------------------------------- APPENDIX -------------------------------- ----------------------- OTHER USEFUL INFORMATION ------------------------- -------------------------------------------------------------------------- (A.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 From To "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 From To "Postscript" "HD40:Spool:Postscript" etc. etc. etc. (A.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]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 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 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]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]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. (A.3) DOWNLOADING A POSTSCRIPT FILE TO AN ATTACHED LASER PRINTER A Postscript(R) file on your mac can be printed in several ways. If you are running system 7.0, you can use the system 7.0 "laserwriter utility". It is likely that this utility will work with system 6.x, but we have not tesed it. We RECOMMEND you use this utility because the other methods rely on shareware software that often BREAKS after a new system is released. There is a good chance that Apple will keep this utility working in the future, There is also SendPS, a free application from Adobe. Currently (3.16.92) "sendps" is broken. It is normally stored in [sumex-aim.stanford.edu]util>sendps-121.hqx There is also something called PS Printer, a free desk accessory; or Hyper PS, a Hypercard stack for sending Postscript files to a Postscript printer. (A.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 This will change the radion button default to B&W. Or, if you have a sector editing program 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. (A.5) YOU WANT TO PATCH THE LASERWRITER 5.2 DRIVER TO COEXIST WITH PEOPLE USING THE 6.1 AND 7.0 DRIVERS If anybody is interested, I've worked out a way to patch the LaserWriter 5.2 driver so that it will coexist on the same shared printer with people using the 6.1 or 7.0 drivers. The principle of the patch is very simple: give the PostScript dictionary a name other than "md"--voila! You can have both the old and new dictionaries loaded, without having to reset the printer. What I did was change the dictionary name to "md68". In the "LaserWriter" file, you'll need to patch occurrences of "md" in the "POST" resources numbered -8161, -8158 and -8156. In the "Laser Prep" file, you'll need to patch the "POST" resources numbered -8192 and -8179. Make sure you don't alter occurrences where "md" is part of a longer word (e g "mdf", "systemdict"). By the way, I did my patching with DeRez and Rez. ResEdit 2.1 doesn't correctly handle "STR#"-format resources (which is what POSTs are) which have zero-length strings in them. I haven't checked if the bug is fixed in 2.1.1. Lawrence D'Oliveiro fone: +64-71-562-889 Computer Services Dept fax: +64-71-384-066 University of Waikato electric mail: ldo@waikato.ac.nz Hamilton, New Zealand 37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00 Coffee, tea, or myalgic encephalomyelitis? (A.6) YOU DO NOT WANT THE LASERWRITER DRIVER TO MONOPOLIZE THE APPLETALK PORT If you're always generating a postscript file to disk, you may not want the laserwriter driver to monopolize the appletalk port. For instance, if you have a "Freedom of Press" Postscript interpreter and a deskwriter connected to the printer port, the laserwriter driver barfs all over your deskwriter every time you select it in the chooser. There is some hope that this procedure can alleviate the problem. This information comes from Brian Mathews (blm@6sceng.UUCP). I just figured out how to do this the other day. Here's how (this is on the 7.0 LaserWriter. It should work on earlier LaserWriter's, but I haven't tried it). The usual warnings apply: only do this on a copy of the LaserWriter file, don't blame me if your Mac blows up, and don't distribute the modified copy. The following works for me on a Plus running 7.0, but your mileage may vary... 1. Move the LaserWriter file out of the Extensions folder. 2. Open the Chooser and close it. These first two steps are necessary because the Chooser caches some flags we'll change in a bit. Unfortunately, it doesn't seem to check the modification date of each file and update its cache if the file's been changed. Grrrr. 3. Fire up ResEdit and open the LaserWriter file. 4. Open the PACK resources. 5. Open PACK #-4096 (it should be the only one). 6. Look at offset 000C into the resource. There should be an E0D2 (for LaserWriter 7.0. For earlier LaserWriters, the number may be different, but the top bit should definitely be 1.) If there isn't, stop now. 7. The top bit of the word (actually the top bit of the long word) at 000C is the Appletalk bit. Turn it off by changing the byte at 000C >From E0 to 60. 8. Quit ResEdit, saying to save changes. 9. Put the LaserWriter file back into the Extensions folder. It's easiest just to drop it on the System Folder and let the Finder scoot it into the Extensions folder. 10. Open the Chooser, and click on LaserWriter. It shouldn't turn on Appletalk, so both of your serial ports are free. If you accidentally try to print (really print, as opposed to just saving the file) with the modified driver, it simply tells you AppleTalk isn't active. I've combined this with the hack I posted yesterday to make saving to a file the default choice in the Print dialog, so it's very easy to flip on the LaserWriter and save off a PostScript file. -- Brian L. Matthews blm@6sceng.UUCP (A.7) YOU WANT TO CHANGE THE DEFAULTS IN THE LASERWRITER DIALOGUE D.G.Gilberts's MyPageSetup Program allows you to alter the defaults on the currrently-selected printer driver. We have been using it for years. Latest version 1.3 is available via anonymous ftp from the usual sites. (including src.doc.ic.ac.uk, in mac/sumex/util/mypagesetup-13.hqx.Z - don't include the ".Z" in your "get" command and it will automagically be de-compressed back to plain binhex for you on the fly !) (also found on 128.252.135.4 wuarchive.wustl.edu in the directory /mirrors3/archive.umich.edu/mac/utilities.print - dwg). Ian Harries Tel: +44 71 589 5111 x5052 Fax: +44 71 581 8024 Dept of Computing, Imperial College, 180 Queen's Gate, London SW7 2BZ Janet: ih@uk.ac.ic.doc Uucp: ih@icdoc.UUCP or ..!ukc!icdoc!ih . DARPA: ih@doc.ic.ac.uk or ih%uk.ac.ic.doc@nsfnet-relay.ac.uk . . . . (A.8) YOU ARE USING THE SYSTEM 7.0 PRINT DRIVER AND THE FILES GENERATED ARE HUGE (1 MEGABYTE OR LARGER). >From Mark I just got StripFonts (HappiWare by James Elliott) to work here. (It took me a while because there is a unix end to the package, and I'm a novice at unix). It's great at stripping fonts that already exist on your postscript printer (typically reducing file sizes by 90% or more). This in turn shortens mac/unix transfer times and printing times. I applaud James for his work -- StripFonts is the solution to the slew of postings I've read about huge sys7.0 postscript files. Below is James posting from about two weeks ago (I trust he doesn't mind me spreading the word). BTW - why hasn't it made it to comp.binaries.mac yet? >From: elliott@veronica.cs.wisc.edu (James Elliott) >Newsgroups: comp.lang.postscript,comp.sys.mac.system >Subject: Re: Printing Postscript Files from a Mac on a Unix system > >People who do this kind of printing regularly may want to keep their >eyes open for StripFonts, a package I just posted to comp.sys.mac.archive >and comp.binaries.mac; it can greatly speed up the uploading of Mac >PostScript files by stripping out the fonts and ProcSets from them; a >library of these is gradually built up on the UNIX side so that each >font and ProcSet needs to be uploaded only once and then never again... > >If the postings seem to be taking too long, you can also get at >StripFonts by anonymous ftp to my machine, veronica.cs.wisc.edu. Look >in the directory src/stripfonts. >-- >Jim Elliott "Like a bridge he'll come between us, not a wall" >elliott@veronica.cs.wisc.edu >From Axello To select which fonts to download to the laserprinter and which fonts to ignore, there is a nice CDEV which controls all this and it also lets you select if the LaserPrep must be included or not. It's 'Trimmer', made by Hugo Ayala. It's available from: [sumex-aim.stanford.edu]/info-mac/cp/ps-trimmer-101.hqx