Double-Page IV by Douglas N. Wheeler Copyright 1990-1991, All Rights Reserved ______________________________________________________________________ INTRODUCTION ______________________________________________________________________ Double-Page is a utility which allows laser printer owners to print text (ASCII) files such that two "pages" of the file are printed on each sheet of paper. The pages are full 66 line by 80 character pages reduced in size so that two of them can be printed side-by-side on a standard 8-1/2" x 11" piece of paper. Alternatively, you can print one 132-column page instead of two 80-column pages. You also have the option to print on both sides of the page, which allows you to print up to four pages on one sheet of paper! This had two advantages over standard printing: 1) You will need half (or a quarter) as many sheets of paper to print the same file. This becomes very important with long program listings. 2) Since Double-Page puts a larger margin along the "top" edge of the page, it is a simple matter to three-hole-punch the pages and put them into a 3-ring binder even if the page contains full lines. ______________________________________________________________________ USING DOUBLE-PAGE ______________________________________________________________________ Double-Page was designed with simplicity in mind. When you first run the program, you will find yourself with a standard GEM menu bar on the screen. The menus are layed out as follows: Desk About Double-Page IV... Displays a title/copyright box. File Print File... Print a file using the parameters set up in the other menus. This will be greyed out if you haven't selected a printer driver. Use Default Font Causes Double-Page IV to use the built-in font (typeface) when printing. Use FILENAME.FNT Causes Double-Page IV to use the font specified. This will be greyed out if you haven't loaded an alternative font. Load Font... Allows the loading of a font from disk. Select Printer... Allows the loading of a printer driver from disk. Save Settings... Saves your current set-up to disk such that the next time Double-Page IV is run, the configuration will be the same Quit Exits Double-Page. Layout 1 x 132 Chars. Causes printout to use the one 132-column page per side mode. 2 x 80 Chars. Causes printout to use the two 80-column page per side mode. Single-Sided Causes printout to use only one side of each sheet of paper. Double-Sided Causes printout to use both sides of each sheet of paper. Collate Pages Causes double-sided printouts to start with the even pages, then print the odd pages. Options Border Causes the printout to have a border around each page on a sheet. Header Causes the printout to have a header at the top of each page. Tab Size (8)... Allows you to change the tab size. The number in parentheses is the current setting. Edit Header... Allows you to change the format and content of the header. Audio Alerts Causes a bell to ring when user action is required (paper need turning over, an error has occurred, etc.). ______________________________________________________________________ OPTIONS IN DETAIL ______________________________________________________________________ 1 x 132 Chars. This mode would be used when the lines in the file being printed extend beyond 80 characters per line. This is useful with spreadsheet printouts and program listings with long lines. In this mode, each page is identical to wide computer paper (132 columns x 66 lines) compressed to fit onto an 8.5" x 11" sheet of paper (sideways) 2 x 80 Chars. This mode would be used when the lines in the file being printed fit within an 80 character line. In this mode, each page is identical to a standard 8.5" x 11" piece of paper (80 columns x 66 lines), although compressed to fit two pages per sheet of paper (sideways). Single-Sided This mode uses only the front of each sheet of paper. This is useful if you don't want to be around to turn the paper over, or if you find single-sided printouts easier to handle. Double-Sided This mode uses both sides of each sheet of paper. Double-Page IV will print the front of each sheet, then alert you to turn the stack of paper over and reinsert it into the printer. Once this is done, it will print the back of each sheet. This mode has several advantages over single-sided: it uses half as much paper, when placed in a binder, the pages are layed out such that you can look at 4 pages at once, etc. Collate Pages Because of the way that some printers feed paper, Double-Page IV gives you the option of printing either the odd or even sides of the sheets first. When collation is off, Double-Page IV will print the odd sides first (use this for the Atari SLM605 with the straight-through paper feed). When collation is on, it will print the even sides first (use this for the Atari SLM804). Border This option turns the printed border on and off. This is a matter of personal preference whether you want a border or not. Header This option turns the printed header on and off. The header, when turned on, will appear at the top of each page. You can edit this header to include useful information about the printout including the name of the file, page number, date, time, etc. Tab Size This allows you to adjust the tab spacing. When you selection this option you will be presented with a dialog box containing buttons for the most common sized (2, 4, 5, and 8 characters) as well as a box for a custom size which you can set to any value from 1 to 40 characters. Edit Header This option allows you to edit the printed header in many ways. You can enter any text which you'd like printed in the header, as well as a number of 'variables' whose value will be filled in automatically by Double-Page IV at print time. The header is composed of three parts: the left part, which is left-justified; the center part, which is centered over the page; and the right part which is right-justified. The variables which may be included are: %F - inserts the name of the file being printed. %P1 - inserts the current page number relative to the start of the current file. %P2 - inserts the current page number relative to the start of the current job (which may consist of multiple files). %D1 - inserts the current date of the month (1-31). %D2 - inserts the current date of the month with a leading 0 if the date is less than 10 (01-31). %D3 - inserts the current day of the week (Sunday - Saturday). %M1 - inserts the current month (1-12). %M2 - inserts the current month with a leading 0 if the month is less than ten (01-12). %Y1 - inserts the current year as a 2-digit number (00-99). %Y2 - inserts the current year as a 4-digit number (1800-2999). %H1 - inserts the current hour in 12-hour format (1-12). %H2 - inserts the current hour in 24-hour format (0-23). %M - inserts the current minute (00-59). %S - inserts the current second (00-59). %AP - inserts the text 'a.m.' or 'p.m.' for morning or afternoon, respectively. %% - inserts a '%' character. The time and date values are computed at the beginning of each file and won't change in the middle of a printout. Keep in mind that if the parts of the header are too long, they may overlap each other. This won't do any harm, it'll just look funny. Audio Alerts With this option selected, the computer will use an audio signal to alert you when it's time to turn the paper over, or when an error has occurred. This is useful if you want to be doing other things while a printout is in progress. ______________________________________________________________________ FONTS ______________________________________________________________________ Double-Page IV has one font (typeface) built in and has the ability to load one additional font from disk. The built-in font contains most of the characters you will need, but does not includes the ST's extended character set (which includes most foreign characters). Included with Double-Page are several fonts, including these: DEFAULT.FNT - this is a copy of the built-in font, but since it's disk loaded, it may be modified. DPRAZR06.FFT - this is the same as the RAZR06LS.FNT which is included with the SLM804 (the characters are the same, the file isn't). SYSTEM.FFT - this is the same as the LIST06LS.FNT which is included with the SLM804, but only contains the characters from 0-127. SYSTEMA.FFT - this is the same as SYSTEM.FNT, but includes all 256 characters in the ST's character set. Double-Page IV supports two different formats for the font files. The first is the .FNT files which are readable ASCII files which can be edited with any text editor. These files take several seconds to load. The second format is a compressed format which, although not easily editable, will load very quickly and take up less disk space. These files have a .FFT (fast-font) extender. See the section entitled 'FONT FILE FORMATS' for more information on the internal structures of the font files. Included with Double-Page IV is a font converter written by Ken Badertscher which will convert between .FNT and .FFT formats. Many thanks to Ken for this utility! ______________________________________________________________________ PRINTERS ______________________________________________________________________ Double-Page IV has the ability to load printer drivers for virtually any 300 dpi printer (laser, inkjet, etc.). Included with Double-Page IV is a driver for the SLM804/SLM605. You'll find that Double-Page IV prints significantly faster than previous versions. This is a result of certain portions of the program that were moved to the printer driver and written in assembly language. See the section entitled 'PRINTER DRIVER FORMAT' for information on writing your own drivers. ______________________________________________________________________ SLM804/SLM605 DRIVER ______________________________________________________________________ The SLM804/SLM605 can automatically detect the device number of the printer (unlike previous versions of Double-Page). Also, the SLM driver accesses the SLM directly and doesn't use the Diablo emulator, GDOS, LaserBrain, or any other driver. The SLM driver will detect SLM804 errors when they occur and give you the opportunity to correct the problem and continue. Possible errors are: INSUFFICIENT MEMORY - there is not enough memory to create the page. The driver needs to have 1 Megabyte of RAM free for the page. TONER EMPTY - your toner cartridge needs replacing. You may be able to continue printing for several more pages, though. PRINTER NOT READY - the printer is not warmed up. Wait until the green 'Ready' indicator is lit before continuing. This will also occur if there is no SLM connected. OUT OF PAPER - the paper tray is empty. If you attempt to print without any paper in the tray, Double-Page will revert to manual feed. DRUM EMPTY - your printer drum needs replacing. You can continue, though print quality may degrade. PAPER JAMMED - a sheet of paper jammed in the printer. Remove it before retrying. If you are printing the backside of a double-sided document, you should put a blank sheet of paper in the paper tray to keep the page arrangement correct. COVER OPEN - the cover of the printer is open. Close the cover and wait for the green "Ready' indicator to light. GENERAL ERROR ## - an error of type ## has occurred. Generally, these errors indicate either a paper jam (see PAPER JAMMED, above) or some sort of hardware problem. Consult your SLM804 manual or local dealer for assistance. ______________________________________________________________________ PRINTING ______________________________________________________________________ You should make sure all of your options are set up before selecting the 'Print File...' menu option. Once you select this option, you will be presented with a standard file selector where you can select the file(s) you wish to print. You can either select a single file, or type in a wildcard such as '*.TXT' which will print all files which have a .TXT extender in the selected folder. If you are using a wildcard, the files will be printed in the order they are on the disk (not necessarily alphabetically), and you have selected double-sided printing, you will be prompted to turn the paper over at the appropriate times and remove the paper between documents. During printing, a status box will be displayed showing the printer in use as well as the file being printed and the current page number being printed. Double-Page IV also supports over-strike printing. If a file contains a backspace character, Double-Page will back up and print the next character on top of the previous one. If the two characters are the same, the second one will be offset slightly to provide a bold appearance. This allows for boldface characters, underlining, and overstriking. ______________________________________________________________________ COMMAND LINE ______________________________________________________________________ Double-Page IV also lets you pass filenames on the command line. This can be done in several ways: Using Neodesk 3 or the Atari TT, you can drag one or more files to the DUBLPAGE.PRG icon and they will each be printed one after another. You can also place the DUBLEPAGE.PRG icon on the desktop for easy access. Using Neodesk 3, or a TT, you can use the 'Install Application' menu option to set Double-Page IV to be a GEM application which take parameters. Once this is done, double-clicking on DUBLPAGE.PRG will bring up a dialog box where you can type in the name of the files to print. Simply type in the file(s) which a space between each name. You can also use Codehead's Hotwire to pass a filename on to Double-Page IV automatically, saving you from typing the filename. Using a CLI (Command Line Interface), you can type the filenames as parameters for Double-Page IV, such as: DUBLPAGE FILE1.TEXT FILE2.TXT Some CLIs require a variation on this since this is a GEM applications to keep the screen from getting messed up. Double-Page IV will also accept wildcards on the command line. Combining this will the ability to pass several names provides many possibilitys, such as '*.C *.H' to print all the .C and .H files in the current folder, or '*.S READ.ME' which will print all the .S files along with the file named 'READ.ME'. ______________________________________________________________________ FONT FILE FORMATS ______________________________________________________________________ Double-Page IV supports two font file formats: .FNT files - these are ASCII (readable/editable) files formatted as follows: DP3 DON'T CHANGE THIS LINE! 189 Copyright symbol 0 0 00000000000001111111111111000000 00000000000111111111111111110000 00000000001110000000000000111000 00000000001100001111111100011000 00000000011000011111111110001100 00000000011000110000000011001100 00000000011000110000000011001100 00000000011000111100001110001100 00000000001100001100001100011000 00000000001110000000000000111000 00000000000111111111111111110000 00000000000001111111111111000000 0 0 999 End of data - DON'T CHANGE THIS LINE! The file consists of three basic parts: The header - the first line which must begin with 'DP3'. The characters - each character consists of two parts: The header - the first line which begins with the ASCI code of the character. The character - 16 lines of 32-bit binary numbers. When printed, a 1 becomes a dot. Note that the characters are pre-rotated for printing. The trailer - the last line which must begin with '999'. .FFT files - these are similar to .FNT files, but the are pre-encoded into their binary counterpart. A .FFT file must contain all 256 characters in the ST's character set (although characters may be blank). The characters are in order by ASCII number, and consist of 16 longwords. Character 0 (which is never used) must be overlayed with a text string starting with 'DP4'. This is how Double-Page IV detects the difference in the 2 different font types; it reads one line of text from the file and sees whether it starts with 'DP3' or DP4'. Since that initial line is read as text, there must be a cr/lf to terminate it. With both types of fonts, once they are loaded into Double-Page IV, the characters 1 through 6 get overlayed with the border characters, so those character may be left blank if desired. ______________________________________________________________________ PRINTER DRIVER FORMAT ______________________________________________________________________ Included with Double-Page IV is a file called PRINTER.S which is a basic skeleton for a printer driver. Double-Page IV calls the printer driver and passes the address of a page layout array and the address of the font the user selected. The driver must then convert the page layout array into a bitmap and print it to the printer. The driver can return an error code which Double-Page IV can act upon in several ways. Consult the PRINTER.S file for additional information and sample code for creating a 300 dpi bitmap from the page layout array. ______________________________________________________________________ SHAREWARE ______________________________________________________________________ Like much of today's "free" software, this one isn't really free. You are free to try it out without payment, but if you decide you like it and would like to continue using it, I do request that you send me a small shareware fee ($10 is suggested) to help offset the time I've spent developing this program. Shareware payments also help decide the future of this program. Send any shareware payments to the address below. ______________________________________________________________________ VERSION II ______________________________________________________________________ Version II of Double-Page added the ability to print double-sided pages, as well as an information line at the top of each "page" consisting of the filename, date, time, and page number. ______________________________________________________________________ VERSION III ______________________________________________________________________ New features include: SLM804 error handling, custom fonts, and custom default settings. Bug fixes include: formfeed character now handled properly (it wasn't handled at all previously), there are now 66 lines per "page" (version II printed 67), and the mouse pointer now changes to a "busy bee" during printing and font loading. ______________________________________________________________________ VERSION IV ______________________________________________________________________ New features include: - True GEM application with menu bar - Supports 1x132 printouts - Allows complete editing of the header - Allows the heard and border to be turned off - Simplifies selecting arbitrary tab sizes - Support the new .FFT small, fast font file format - Supports alternate printers through loadable printer drivers - Allows for wildcard (and multiple wildcard) printouts - SLM driver automatically detects the SLM device number - Allows pages to be collated - Has option for audio alerts for user interaction - Print speed has been increased greatly - Overstrike printing is supported ______________________________________________________________________ THE FUTURE ______________________________________________________________________ I have a few ideas for future versions of Double-Page. Whether or not there even ARE future versions depends upon shareware contributions. If you have any suggestions, comments, or complaints, send them to me at (address subject to change): Doug Wheeler 3655 S. Delaware St., #317 Englewood, CO 80110 GEnie address: DOUG.W