Classic Computer Magazine Archive ST-Log ISSUE 23 / SEPTEMBER 1988 / PAGE 24

APPLICATION

ALL RESOLUTIONS

DOUBLE COLUMN PRINTING UTLITY

by Frank Cohen

Frank Cohen has been developing software for Atari computers since 1983 when he wrote his first game, Clowns and Balloons. He recently joined ST-Log as a contributing editor. He may be contacted for more information on DELPHI (REGENTWARE) or CompuServe (72457, 3171).

The program is fairly sophisticated—its functions cover enough of the formatting commands to print a user-group newsletter, a report or any double column document.

The Regent Word II Double Column Utility program is a full-GEM program that uses the mouse to point and click on the document file to be printed. When the document is printed, the text will be formatted into a double-column format such as you would find in a newspaper or magazine. Note that, due to the size of this program, the program listings are not printed here. They are available on this month's disk version or in the ST SIG on DELPHI.

The program is fairly sophisticated; most of the Regent Word II print format commands are supported, including Page Breaks, Justification On / Off, Header Definition, Footer Definition, Primary and Secondary Left Margins, Right Margin Setting, Bold Print, Underlined Print, Italic Print, Super and Sub-scripted Print.

These functions cover enough of the formatting commands to print a user-group newsletter, a report or other double-column document. The other formatting commands are ignored (i.e., Pitch, Font, Line Spacing, etc.).

To start the program from the GEM Desktop, move the mouse pointer over the icon or file named PRINT.PRG and double-click the left mouse button. You may also click the left mouse button once and use the OPEN drop-down menu selection. After a few moments the title screen will appear as shown in Figure 1.

To use the utility, move the mouse pointer over the Continue button and click the left mouse button. All functions are accessed through the drop-down menus that appear on the top of the screen.

The Double Column Utility program supports many print styles, e.g., bold, underlined, etc. As Atari never authorized any particular printer to be the standard ST printer, the utility program must be flexible enough to support all possible printers. A printer is supported through a "printer driver."

A special program has been included with the Double Column Utility to create a printer driver and the program is run from the GEM Desktop. I've included several pre-defined printer drivers, which you can modify using the Printer Driver Create program.

If you want to use one of the predefined printer drivers, skip the following section. When the Double Column Utility is started, no printer driver has been selected. The default settings are compatible with Epson-compatible printers. Use the Printer Driver Create program to customize a printer driver to your printer.

Creating your own printer driver

If you wish to develop your own printer driver, move the mouse pointer over the PDCREATE.PRG file on the GEM Desktop and double click the left mouse button. A dialog box will appear as shown in Figure 2.

Click Create a new Driver to enter a new printer driver. Figure 3 shows the special edit window which will appear. The printer control commands that make up a printer driver are shown. When you press a key, the key character will appear at the location of the cursor.

The first printer control code is used to instruct your printer to begin printing using a special font (e.g., pica, elite, etc.). Refer to your printer manual for the exact codes to control your printer. Enter the decimal values. If there is more than one number, separate the numbers by commas. To enter the next printer control code press the down arrow key. The cursor will jump to the next line.

Once you have finished entering values, press the return key. The dialog box shown in Figure 4 will appear, asking for the file name of the new printer driver. Type the filename, and press the return key. After a few moments the GEM Desktop will appear, and the new printer driver will have been successfully created and may be used in the Double Column Utility.

Move the mouse pointer over the PRINT.PRG file, and double-click the left mouse button. The Double Column Utility title screen will appear. Press Return or click the continue button.

Selecting a printer driver

When the Double Column Utility is first started, the program defaults to an Epson setting. To select a printer driver, move the mouse pointer into the printer drop-down menu, and click the choose printer driver option.

The file selector window will appear as illustrated in Figure 5. Printer drivers have a file extension of .W2P, so the file selector window will show only those file types. Move the mouse pointer over the printer driver name and then double-click the left mouse button. Once the printer driver has been loaded, the printer drop-down menu will indicate which driver was last loaded as you can see in Figure 6.

Figure 6.

The program also supports foreign characters, and the selected country is shown with a check-mark in the printer drop-down menu. The country may be changed by clicking the left mouse button while the mouse pointer is over a country name.

Setting the format

The next step is to adjust the page layout. The default settings will print the document on a normal 8 1/2 × 11-inch sheet of paper, with a two-inch margin. Figure 7 shows how to set the print formatting. You probably will not have to adjust these settings, unless you have a special job in mind.

Figure 7.

To adjust the format settings, move the mouse to the Choose drop-down menu. Select the Set Format option by clicking the left mouse button while the mouse pointer is over the Set Format item. The format screen will appear.

Figure 8 shows the various page layout adjustments that you can set from the format screen, including Page Length, Top Margin Length, Bottom Margin Length, Column 1 Width, Inter-Column Width, Column 2 Width, Primary Left Margin, Secondary Left Margin and Right Margin.

A vertical cursor will appear in the top margin setting adjustment. Pressing the escape key will clear the old contents. Enter the number of lines for the top margin (as measured from the top of the page down).

The Up Arrow and Down Arrow keys may be used to move to the next or previous adjustment. Once all of the adjustments have been made, press the return key or click the left mouse button while over the OK box. The format screen will disappear.

Printing the document

To begin printing your document, first check that your printer has been turned on, switched online, and that paper has been loaded. Move the mouse pointer into the Choose drop-down menu, and click on the Select Document option. The File Selector will appear. Move the mouse pointer over the desired document file, and click the left mouse button.

Don't worry if you click on the wrong document as the program will first check to make certain the document is a Regent Word II file as shown in Figure 9.

Figure 9.

If everything has been done correctly, the dialog box shown in Figure 10 will appear on the screen, indicating the page number being printed. The document will be printed according to the format information you have provided.

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Once you've printed a document, you may exit the Double Column Utility by moving the mouse into the Choose drop-down menu, and clicking on the Quit entry.

Page layout

The layout of each printed page can be set while editing the document in Regent Word II. Load Regent Word II by clicking on the WORD2.PRG program from the GEM Desktop. Then load into Regent Word II the document you will be printing using the Double Column Utility.

The Double Column Utility program formats the document to the two-column format described in the format screen. However, certain other functions may be used by defining special rulers while using Regent Word II, such as page breaks, header/footer definition, etc.

Since the utility program formats the page for two columns, special ruler settings must be used to correctly view the document as it will be printed. Set the first margin ruler to these settings for two column printing:

LM1 = 8 LM2 = 5 RM = 35

This sets the primary left margin to 8, secondary left margin to 5, and right margin to 35. To change the margin ruler settings, move the mouse pointer over the LM1 = 5 entry and click the left mouse button. The information line will ask for the new value of the primary left margin (LM1). Type 8 and press Return. Set the other margin ruler settings.

Figure 11 shows how your document will appear on the screen once the ruler settings have been changed. Each paragraph will be indented by three characters (LM1 = 8).

Page breaks may be made visible by moving the mouse pointer into the Special drop-down menu as shown in Figure 12 and clicking the Show Page Breaks option. A horizontal line will appear at a page break. The visible page breaks appear at the end of a sheet of 8 ½ × 11-inch paper. This may be adjusted for double column printing by adjusting the values found in the Global Format screen.

Figure 12.

Move the mouse pointer into the print dropdown menu and click on the Global Format entry. Figure 13 shows the printing options that may be set from this dialog box. Change the page length to 108. This value was arrived at by subtracting the top margin and bottom margin from the page length. The result is multiplied by two (for double columns). Once the new value has been entered, press the return key. The Global Format screen will disappear.

With the new page length, the visible page breaks will show where each page ends. Scrolling downwards will show additional page breaks.

To avoid "widows" and "orphans" (this occurs when the last sentence or word of a paragraph overlaps to the next page), you may insert a page break ruler within your document.

Headers and footers

The Double Column Utility will also print two lines of header and footer information at the top and bottom of every page. A Header Definition ruler is used to define a header. After a header has been defined, the utility program will print the two lines at the start of every page—provided the top margin allows enough room.

Wrapping it up

The Double Column Utility was fun to write, and I hope it's useful. I might even expand it to print graphics. If you have any suggestions, I can be contacted on DELPHI; my handle is REGENTWARE.

Figure 8.

Figure 11.

Figure 10.

Figure 13.