APPLICATION NOTE #178 USING THE LASERJET II OR IID TO CREATE A LEGAL FORMAT Rev. 01 Many legal documents use standard formats that include line numbers and rules. This application note describes how you can use a Hewlett Packard LaserJet Series II or IID to create two of these standard formats and superimpose them on the legal document when you print it. Both procedures require making a template file, printing that file to disk using XyWrite's TYPEF command, and then embedding most of the resulting file in the legal document as part of a running header. MAKE TEMPLATE FILE The template file sets up the standard format. It includes XyWrite formatting commands and Hewlett Packard PCL (Printer Control Language) coding (see Note #1). The formatting commands place the line numbers, while the PCL coding draws the rules and positions the text. You put the PCL coding in a XyWrite PI (Printer Insert) command. The PI command is an embedded command that allows you to send a control string directly to the printer--XyWrite does not process information in a PI command. (Refer to Chapter 4 of the XyWrite III Plus Reference Guide for more information on the PI command.) The following procedures describe how to create two different legal formats: 1. Line numbers with two vertical rules 2. Line numbers with a single ruled box Style 1: Line Numbers and Two Vertical Rules To create a legal format that has line numbers down the left margin, separated from the text by two vertical rules, perform the following steps. 1. Load your regular LaserJet printer file. 2. Create a new file and embed the following commands (shown here in expanded mode): <><><><><><> <> You can change the values of the TP, PT, and PI commands, but do not change the FF, LM, OF, or PL values (see Note #2). If you change the PI command (see "Customizing PCL Commands"), you will probably have to change the PI command in step 5 also. 3. Next to these commands, type the number one and a carriage return (see Note #2). 4. On the next line, type the next line number and a carriage return. Continue entering line numbers until you reach the highest one you want on a page. Do not place a return after the last one. 5. Be sure you are in expanded mode. Immediately after the last line number, type the following PI command: < 2. Print the template file to disk. For example: Type: F5typef template 3. Issue the WAIT command. Type: F5wait 4. Turn on the EJ default. Type: F5default ej=1 Result: XyWrite creates a file named FO.TMP that includes the printer coding needed to position the rules and line numbers exactly as you want. You can use this format repeatedly, without modification. Next, you must delete some code at the end of this printer-ready file. 1. Call the formatted file to the screen. Type: F5ca fo.tmp 2. Move the cursor to the end of the file. Press: Ctrl-End 3. Delete everything after the string "0x0y." Press: F1 Type: F5seb /0x0y/ Press: Ctrl Right Arrow Press: F1 Press: Alt-F6 Finally, turn this file into a PI command. 1. Go to expanded mode. Press: Ctrl-F9 2. Move the cursor to the end of the file and enter a closing double angle bracket (>>). Press: Ctrl-End Press: Ctrl > 3. Move to the top of the file and enter an opening double angle bracket and the PI command. Press: Ctrl-Home Press: Ctrl < Type: PI 4. Store this file to disk with a new name. For example: Type: F5st legal.fmt Result: You now have a formatted template that you can merge into any document to produce line numbers and rules. You can use this format over and over without modification. INSERT TEMPLATE INTO DOCUMENT To superimpose the template on your documents, you put it into a running header in the document itself. This means that the rules and line numbers will be printed on every page. The PCL coding to reposition the cursor ensures that XyWrite can start printing at the upper left corner of the page. 1. Display the legal document on the screen. 2. With the cursor at the top of the file, issue an RH (Running Header) command. Type: F5rh Result: A text window opens on the screen. 3. Use the Merge command to place the contents of the template file into the running header. Type: F5me legal.fmt 4. Establish a top margin by typing carriage returns or issuing an EL (Extra Lead) command (see Note #3) as part of the running header. Type: F5el 5 Result: Another triangle appears in the text window. When you print your legal document, the text will start on line 6, without affecting the positioning of the line numbers. 5. Add any other formatting commands you require in the running header (e.g., a page number, caption). 6. Close the text window. Press: F3 7. Add the appropriate formatting commands for the text itself. For example: Type: F5tp 0 Type: F5of 6 8. Send your document to the printer and store. Type: F5type Type: F5store CUSTOMIZING PCL COMMANDS You can customize many components of the PCL coding to achieve the ruled format you need. For instance, you might want slightly heavier rules, or a narrower box. The PCL coding specifies everything in 300ths of an inch, the finest unit of measurement the HP can handle. Its commands always start with an escape character (), followed by one or two characters which establish what type of command it is, and then the variables you want to specify. The variables usually contain a number and a letter. The letter must be uppercase if it is the last character in the command; otherwise it must be lowercase. The commands used in our format are: *p Establishes the printing position. Movement may be either absolute (measured from the upper left corner) or relative (measured in relation to the current position). *c Establishes or prints a rectangular area. The LaserJet does not actually print rules; it prints very skinny rectangular areas. The variables used here are: x Identifies the horizontal axis. y Identifies the vertical axis. a Identifies the width of a rectangular area. b Identifies the depth of a rectangular area. p Prints the rectangular area. The PI command used to place vertical rules works as follows: {esc}*p100x0Y Move to starting printing position using absolute position. {esc}*c2a3000b0P Set rule size to 2/300 in. wide, 3000/300 in. long; draw the first rule (the zero indicates "solid" rather than patterned fill). {esc}*p+10X Move to printing position for second rule using relative position. {esc}*c0P Draw the second rule. {esc}*p0x0Y Change the printing position to the upper left corner of page using absolute position. The PI command used to construct a box works as follows: {esc}*p100x0Y Move to starting printing position using absolute position. {esc}*c2300a2b0P Size rule to 2300/300ths wide, 2/300ths deep (this will be the top horizontal rule); draw the rule. {esc}*c2a3000b0P Size rule to 2/300ths wide, 3000/300ths long (this will be the left vertical rule); draw the rule. {esc}*p+2298X Move to printing position for right vertical using relative position {esc}*c0P Draw the rule. {esc}*p100x+3000Y Move to printing position for bottom horizontal, using absolute position for x-axis, relative position for y-axis. {esc}*c2300a2b0P Size rule to 2300/300ths wide, 2/300ths deep; draw the rule. {esc}*p0x0Y Change the printing position at the upper left corner of page using absolute position. Note #1 PCL Coding. For detailed information on PCL coding, refer to the Hewlett Packard LaserJet II Technical Reference Manual. Note #2 Skipping Lines. If you do not want to number every line, enter the appropriate LS (Line Space) command at the beginning of the file. For instance, if you plan to number only every fifth line, enter LS 5. Then, when you type the actual line numbers, type 5, 10, 15, etc. rather than 1, 2, 3. . . . Note #3 Top Margin Command. The template is set up to position the line numbers and rules exactly where you want them. If you put a TP (Top Margin) command in your legal document, it will affect this placement. ###