(c) Copyright 1989-1999 Amiga, Inc. All rights reserved. The information contained herein is subject to change without notice, and is provided "as is" without warranty of any kind, either expressed or implied. The entire risk as to the use of this information is assumed by the user. Troubleshooting PostScript Printers by Bryce Nesbitt Using a PostScript printer with the Amiga for the first time is a straight forward affair but there are some difficulties that you may run into. Some laser printers use a default handshake which won't work with the Amiga. Several companies have reported customer support headaches caused by mismatched handshakes. This article discusses how to set handshaking and baud rate configurations on PostScript printers for the best results with the Amiga. If you have a PostScript application, you may want to reproduce the information given here in your user's manual. The PostScript examples in this article have been tested on laser printers made by Apple, NEC and A.S.T. Interface We recommend that you use the serial (RS-232) interface with your PostScript printer. PostScript is bi-directional - that is, the printer can send error messages and other information back to the host. While the Amiga's parallel port is also bi-directional, the parallel port on a typical laser printer will not be. So use the serial port if possible. The required cable is simple. Wire the two serial interface connectors as follows: Lauren, put artwork here. Preferences Some problems occur because the user has set Preferences incorrectly. The Preferences serial port parameters should be set to 8 data bits, 1 stop bit, Xon/Xoff handshake, no parity and either 1200 or 9600 baud depending on the setup of your printer. On most printers, the 1200 baud setting is not adjustable while the 9600 baud setting is fully programmable. Set the printer and Amiga to 1200 baud if you are having communication difficulties. There is less to go wrong this way. Handshake Another common problem is the inability to print complex documents. Often, when a simple document is printed it works fine but when a complex document is printed, the printer produces no output. In most cases, this is due to a handshaking problem and can be corrected by matching the handshake between the Amiga and the printer. To find out what kind of handshaking your printer uses run the PostScript program shown below. Use a text editor like emacs, ed or notepad to type in the program: ------------------------- Lauren this is code ---------------------------- /Helvetica findfont 20 scalefont setfont 40 200 moveto statusdict begin 25 sccbatch (The Options number is ) show 10 string cvs show (. The baud rate is ) show 10 string cvs show (.) show end showpage ------------------------- End of code ---- ---------------------------- Save the file as "shake" and exit the text editor. From the CLI, copy the shake file to the serial port with a command such as "copy shake ser:". This will send the PostScript program to the printer where it will be run. The printer should print a sheet of paper. If nothing seems to happen, cycle the power on the printer, wait a moment, and try again. The output should look like this: The Options number is 0. The baud rate is 9600. ^ [Lauren, use the artwork here...] If your options number is in the range of 0-3, the handshake is properly set to Xon/Xoff. If your options number is in the range of 4-7 there is a problem. The printer is set to DTR handshake (DTR goes low when the printer's buffer is full). This won't work well with the Amiga. The options number is interpreted as follows: 0 or 4 Ignore parity 1 or 5 Check for Odd parity 2 or 6 Check for Even parity 3 or 7 No parity For the Amiga, options should be set to 0. Some printers have switches or front panel controls for the options and baud rate. If you have one of these, look in your manual for the correct settings. Other printers require a PostScript program like the one given below. Replace BAUD and OPTIONS with the numbers you wish to set. To start with, use 0 for options and 1200 for the baud rate. ----------------------Lauren, code begins here ------------------- serverdict begin 0000 exitserver statusdict begin 25 BAUD OPTIONS setsccbatch end ----------------------Lauren, code ends here ---------------------- Type the program in using your text editor and run it by copying it to the ser: device as described above. This will change the internal baud and options settings. The settings will stay in effect even if you turn off the power. You should not change settings more often than necessary, though. The EEPROM device that stores the settings wears out after about 10,000 uses. After running the program, either send a CTRL-D to the printer or wait 30 seconds for the changes to take effect. More Speed The 9600 baud default of most laser printers is not very fast. Printers with PostScript 38.0 and above can be set to higher baud rates. See your printer manual for the exact list of baud rates supported. Typical legal values are: 1200, 9600, 10473, 11520, 12800, 14400, 16457, 19200, 23040, 38400 and 56700. 19,200 baud is the recommended speed for use with the Amiga. This speed can be set with the same PostScript program that sets the Options number. PostScript Programming Copying files to ser: is not the best way to run your PostScript programs. If you want to experiment with PostScript, it is much better to use PostScript's interactive mode. Any terminal emulator or modem program should work. Set the baud rate, parity and stop bit settings to match those of the printer, then follow these steps. First, type one CTRL-D to the printer (hold "CTRL" and press "D"). This will end any current job the printer is working on. If the printer is an Apple LaserWriter, the flashing activity light should stop. Next type the word "executive" followed by a return. If all works well, you will be in PostScript's interactive mode. You should see a copyright message. To read out the current settings, type in the following. What you type will be shown in courier-boldface, what postscript types back is in courier. ------------------------------Lauren, code starts here----------------- ^D executive PostScript(r) Version 47.0 Copyright (c) 1984, '85, '86, '87 Adobe Systems Inc. Copyright (c) 1981 Linotype All Rights Reserved. PS> PS>statusdict begin PS> PS>25 sccbatch PS>= 0 ;<- mode byte PS>= 9600 ;<- baud rate PS> PS>end PS>quit ^D ---------------------Lauren, code ends here ------------------------- This sequence prints out the options and baud rate just like the previous program. Don't forget the CTRL-D at the end. Here is a brief description of the code. The "statusdict begin" tells PostScript you wish to access functions from the special status dictionary. The "25 sccbatch" line first pushes the number 25 on the stack, then executes "sccbatch". The 25 is a parameter to sccbatch indicating you want information about the 25 pin RS-232 port. The sccbatch operator leaves two numbers on the stack. The topmost will be the serial mode byte, the next will be the baud rate. The "=" command reads the top number from the stack and prints it to your terminal. In this case, the printer was configured for mode 0 and a baud rate of 9600. You can multitask your favorite editor with the terminal program. Prepare the PostScript file in the editor. Then to test your program, send the file to the printer with the "send ASCII" option of the terminal program. In interactive mode, typing CTRL-T will produce a status report from the printer. CTRL-C will abort any currently executing job. CTRL-D will end the current job. A Sample Progam No article about PostScript is complete without a typesetting example. Here's mine: --------------------------Lauren, code begins here------------------------ /showit %stack: (string) {0 0 moveto show} def /oshowit %stack: (string) {true charpath stroke} def /Helvetica findfont 100 scalefont setfont 150 150 translate .90 -.10 0 {setgray (Amiga) showit 10 rotate} for 1 setgray (Amiga) showit 0 setgray 0 0 moveto (Amiga!) oshowit showpage ------------------------Lauren, code ends here------------------------- [Lauren, insert artwork here] Remember, to get the best results with PostScript you have to set Preferences to the correct values. You must also make sure the printer uses the right kind of handshake and the right baud rate. We recommend that you connect PostScript printers to the Amiga's serial port. If you need to make a serial cable follow the wiring diagram shown above. By following these steps your PostScript print outs will be trouble-free. References Adobe Systems, Inc. PostScript Language Reference Manual. Addison-Wesley, Reading, Mass., 1985. Adobe Systems, Inc. PostScript Language Tutorial and Cookbook. Addison-Wesley, Reading, Mass., 1985.