PrintDocs.rexx and PrintEnvelope.rexx Two scripts written in ARexx intended for use with the Hewlett-Packard DeskJet printer. PrintDocs will print 120 lines of text on a single 8 1/2 x 11 sheet of paper in landscape mode with 60 lines of text on each half of the sheet. Line lengths up to 80 characters can be accomodated using the printer's internal 6 point Courier font with a pitch of 16.67. Using a pitch of 20 will permit up to 96 characters per line. PrintEnvelope will address a #10 envelope (4 1/8 x 9 1/2 in.) in a 12 point font using either the CG Times or Courier typeface. In addition, a simple script has been provided for users of the Qed text editor which allows one to use PrintDocs directly from Qed. Disclaimer ========== The information and the scripts provided herein are offered "as is" without warranty of any kind, either expressed or implied, regarding the use of these scripts or the results of their use. These scripts may not be redistributed without this accompanying ReadMe file. Credits ======= Denny Atkin- for his help in beta testing. DeskJet is a trademark of Hewlett-Packard. ARexx is copyright © 1987 by William S. Hawes, All Rights Reserved. Amiga, AmigaDOS and Workbench are trademarks of Commodore-Amiga, Inc. RexxArpLib is copyright © 1988, 1989, 1990, 1991 by W.G.J. Langeveld. ReqTools is copyright © 1991-1993 by Nico François. RexxReqTools is copyright © 1992-1993 by Rafael D'Halleweyn. System Requirements =================== You must have ARexx installed on your system in order to use these scripts. ARexx has been included as part of the operating system release since OS v2.04. In addition, you must have one of the following: 1. The rexxarplib.library. The current version of rexxarplib as of this writing is v3.0, available on GEnie in file #12443, RAL3P0.LZH. This -may- permit the scripts to work on OS 1.3 but could not be verified. NOTE: The rexxarplib.library also requires the arp.library, available on GEnie in file #8364, ARPLIB_V391.LZH. The sole use of the arp.library under OS versions later than 1.3 appears to be the wildcarding routine. ARP requesters are not used in these scripts, unless you wish to use them with OS 1.3. If you use a 68040 CPU on your Amiga, you will also need a patch to fix the arp.library so that it is compatible with the 68040. This is available on GEnie in file #18268, ARP040FIX.LZH. - OR - 2. Both the reqtools.library and rexxreqtools.library. RexxReqTools requires OS 2.0 or greater. Although there is a reqtools library for OS 1.3, the rexxreqtools.library will not work with this version of the reqtools.library. - OR - 3. Amiga OS 3.0 (RequestChoice and RequestFile commands). The necessary ".library" files (in the event you do not have OS 3.0) must be present in the LIBS: directory. While it is likely that the rexxarplib versions of the scripts will work on OS versions earlier than v2.04, it has not been possible to verify this. PrintDocs.rexx will work on any DeskJet excepting the original model. It may work on an original DeskJet if you have installed the HP2270K landscape cartridge but this could not be verified. PrintEnvelope.rexx will work on any DeskJet while using the Courier typeface, as long as you have an out tray that is designed for printing envelopes (standard on the 500 and later models, don't know about pre-500's). Using the CG Times typeface requires a DeskJet 500, 500C or 550C. Script Versions =============== Amiga OS Version Script version 1.2/1.3 2.04/2.1 3.0 RxArpLib * X X X ReqTools * X X Version3 X * Requires additional library files. See "System Requirements". The two scripts are provided in three different versions. Determining the proper version to use depends upon your system software. Use the guide above for assistance. Functionally, they are identical and differ slightly only in the appearance of the requester gadgets. Copy the appropriate versions to the directory you have assigned as REXX:. If you have the reqtools.library (by Nico François, which enhances various system requesters) and the rexxreqtools.library (provides an ARexx interface to the reqtools.library), then you may use the ReqTools scripts rather than the RxArpLib scripts. The only advantage these scripts have over the RxArpLib scripts is an improved "query" requester appearance and functionality which saves one step in the PrintDocs.rexx script when selecting typefaces and print quality. If you do not have these libraries and wish to try them, the latest versions available on GEnie (as of this writing) are in file #21035, REQTOOLS21F.LHA. These scripts were tested using the rexxreqtools.library v37.50 and the reqtools.library v38.1095. Icons have been provided for use with the Workbench which are optional and they may be copied to any convenient location. As long as the scripts are in REXX:, the icons will function properly. Usage ===== Both scripts may be run from the shell or from the Workbench, using the provided icons. The command line format is: Rx PrintDocs -or- Rx PrintEnvelope If no file name argument is given, you will be presented with a file requester. After that, you will be presented with a requester to select the typeface and print quality options (PrintEnvelope always prints in letter quality mode). Once you have gone beyond the file requester, there is no way to cancel the script from the Workbench/shell other than running the "HI" command from a shell. I have found that pressing the "ON LINE" button on the printer followed by the "RESET" button works well. PrintDocs.rexx ============== In testing the script I found that the printer would appear to stop before doing any printing at all, and then start up again within 10 to 15 seconds. Enhancements to the scripts have sped the process up so that I now get little if any lag time when running my DeskJet 500. However this may still occur when using an older DeskJet, an Amiga with a 68000 CPU, or during periods of intensive multi-tasking. There are several things one needs to be aware of. Both scripts write directly to the parallel device (PAR:). Any settings made with Preferences (including printer driver) will have no effect on the operation of the scripts. If you have your DeskJet connected to the serial port, rather than the parallel port, try editing the scripts, changing "PAR:" to "SER:", but I have no idea whether this will work. Because the script writes directly to PAR:, escape sequences like: *E[4mThis line is underlined*E[0m will appear exactly as you see it here, since the printer driver is not interpreting the escape sequences. No attempt has been made to create an all encompassing print utility. It is a simple means of printing text files much like this one, quickly, without using alot of ink and paper in the process. You should check the file you wish to print with before you actually print it, in order to choose the appropriate font pitch. The script does not make any attempt to wrap lines that are too long. As noted above, lines up to 80 characters in length can be accomodated with a pitch of 16.67 while a pitch of 20 can accomodate lines of up to 96 characters in length. If the length of a particular line exceeds the limit, any characters beyond the limit are stripped off. Trailing spaces and linefeeds are not counted as part of a line for the purposes of length. There is one modification that you can make to text files that will force PrintDocs to treat each half sheet of paper as a separate page. Adding a formfeed (Ctrl-L), will cause printing to continue at the top of the next half sheet of paper. If lines prior to the formfeed were printed on the left half, subsequent lines will commence at the top of the right half. If lines prior to the formfeed were printed on the right half, subsequent lines will commence at the top of the left half of the -next- sheet of paper. The formfeed MUST appear on a separate line, by itself as the first character on the line. Anything else on that line is ignored and furthermore, that line is not counted as a printable line. Remember: 60 lines per "page". To see how this works, try printing the "ReadMe.format" file (using PrintDocs) and compare it with this one. PrintEnvelope.rexx ================== To use PrintEnvelope, you will need to create a file for each address which contains exactly the information you wish to print (i.e. name on the first line, street address on the second, etc.). Up to six lines are allowed and anything over six is ignored. Unfortunately, it was not possible to implement a means of printing the return address on the envelope. The closest the DeskJet can get to the upper left corner is still roughly 3/4 of an inch from the top and the left side of the envelope, not close enough to be practical. PrintDocs.qed ============= This simple ARexx macro was included for those using the Qed text editor and can be used as a guide for similar macros for other text editors. The contents of the editor's buffer are saved to a file named T:QPrint. If you have marked off a block of text, then the marked text will be saved to T:QPrint. This file name is then passed as an argument to PrintDocs.rexx which will then delete T:QPrint after printing the contents of the file. If you write a similar macro for another editor, use the filename "T:QPrint" and the file will be deleted automatically when printing is finished. Problems ======== I don't know of any bugs associated with these scripts at present. Because their operation is quite straightforward, there are very few things that could cause them to fail. Some possible scenerios include: 1. Improper or missing library file- read the section on system requirements. Both the ReqTools and RxArpLib versions require multiple library files. If you choose to use the ReqTools versions, you should have rexxreqtools.library v37.50 or later. Earlier versions had some nasty bugs. 2. ARexx not running- if you wish to use the scripts from the shell, you must run Rexxmast first. When using the scripts from the Workbench, ARexx will be started automatically if not already running. 3. Very early model DeskJet- as mentioned earlier, operation on the pre-Plus model DeskJets has not been verified. If you have any problems or questions, feel free to send EMail. Dean Adams GEnie: D.ADAMS21 Internet: d.adams21@genie.geis.com December 14,1993