A BASIC program can be used to change the Imagewriter's printing style. The Imagewriter User's Manual contains a listing of the different printer codes and their meaning.
The following sample program changes the type size to 17 characters per inch:
10 D$ = CHR$(4) : REM DOS and ProDOS commands access the printer.
15 REM CHR$(4) makes DOS or ProDOS look for a command.
20 PRINT D$;"PR#1" : REM Turn the printer interface card on.
30 PRINT CHR$(27); CHR$(113);
35 REM CHR$(27); and CHR$(113); change type to condensed size (17 CPI).
40 PRINT "THIS IS A TEST" : REM Print something to test the new style.
50 PRINT D$;"PR#0"
55 REM Turn off the printer interface card and turn on the screen output.
56 REM For 80 column screen output, replace the number 0 with the number 3.
60 END
Line 30 is the key to obtaining the smaller type size. The Imagewriter
recognizes these two characters (27 and 113) as the command to change to
condensed print. You will find these codes in the text of the Imagewriter
User's Manual and on the foldout card in the back of the manual.
Use the foldout card to find the code for a feature you wish to use and enter
the corresponding decimal codes in a print statement. For example, to obtain
boldface printing, replace line 30 with the statement 30 PRINT CHR$(27);
CHR$(33);
Some features have a series of n's in the decimal code column on the foldout card. Replace these n's with a number that has as many numerals as there are n's in the code, and PRINT the code with the number. For example, the foldout card shows that to set the left margin, send the characters Escape, L, and nnn or send the decimal codes 27, 76, and nnn. This means that the value of the left margin must be sent as a three digit number. If the margin value has only two digits, put an extra zero on the left. For example, to set the left margin to 15, replace line 30 with the statement 30 PRINT CHR$(27); CHR$(76); "015";
The Apple ImageWriter and Dot Matrix Printer have special modes which allow them to generate custom-design characters. To get the most definition for each caracter it is useful to be able to control all eight bits of the data being sent to the printer. The following program example illustrates the use of a routine which allows for all eight data bits to be significant. It demonstrates an example in the ImageWriter User's Manual Part 1: Reference on pages 69 and 70.
10 D$ = CHR$(4)
20 FOR I = 768 TO 773: READ J: POKE I,J: NEXT I
30 PRINT D$;"PR#1"
40 FOR I = 1 TO 14: READ J: POKE 769,J: CALL 768: NEXT I
50 PRINT CHR$(27)"*&&&" CHR$(27)"$"
60 PRINT D$; "PR#0"
70 DATA 169,4,76,237,253,96
80 DATA 27,45,27,73,166,71,0,72,72,126,72,72,0,4
* Line 20 reads the data from line 70 and POKE's a machine language routine into the computer.
* Line 30 activates the printer.
* Line 40 reads the data from line 80 which is a string of data defining a custom character, the plus/minus character as shown in the ImageWriter manual. It is defined using eight bit data where all eight bits are required.
* Line 50 uses the custom character.
* Line 60 returns the output to the screen.
Article Change History:
16 Dec 1996 - Reviewed for technical accuracy, revised formatting.