APPLICATION NOTE #141 USING POSTSCRIPT TO CREATE A LEGAL FORMAT Rev. 02 RELATED FILES: BRIEF.PRN, BRIEF.TXT Many legal applications use a specially formatted paper that includes the company name and address in the top left and lower right corners of the page, line numbers in the left margin, and two vertical lines that separate the line numbers from the text. This application note describes how you can use PostScript and XyWrite to create this special format and superimpose it on the legal document when you print it. To produce this type of legal format, you need a special printer file and a text file that contains your company's name and address. For your convenience, the files used to create the format shown above are available upon request from XYQUEST. If you need them, call Technical Support and ask for copies of BRIEF.PRN and BRIEF.TXT. To use them, just modify the text in BRIEF.TXT to suit your application, load BRIEF.PRN, and then skip to step 9 under Creating the Format File." If you prefer to create your own versions of these files, start with "Create a Special Printer File." CREATE A SPECIAL PRINTER FILE The first step in this process is to create a special printer file that contains the PostScript commands for drawing the vertical lines and repositioning the cursor at the top left corner of the page. 1. Make a copy of your standard PostScript printer file. For example: Type: F5copy 3post.prn,3brief.prn 2. Call the new file to the screen and move the cursor to the FB< (File Begin) string. Type: F5call 3brief.prn Type: F5se /fb 3. Delete the existing File Begin string (which starts with fb< and ends with a carriage return). 4. Enter a File Begin string that contains the PostScript codes for drawing two vertical lines. For example: Type: fb< )newpath 55 0 moveto 0 780 rlineto 58 0 moveto 0 780 rlineto stroke closepath( The numbers in this string define x and y coordinates that tell PostScript exactly where on the page to start and end each vertical rule. You may want to experiment with different values until you get the result you want. (Refer to the PostScript Language Reference Manual published by Adobe Systems, Inc. for detailed information on PostScript programming.) 5. Move the cursor to the FE< (File End) string and replace the existing information with the following: Type: FE< )/x 18 def /y 780 def l save( This string returns PostScript to the top left corner of the page after it draws the vertical lines, putting it in the correct position for text output. 6. Move the cursor to the PG< (Page Break) string and delete the information that appears between the less than symbol and the carriage return. The new PG string should look like this: PG< This string prevents XyWrite from outputting a page break at the end of the file. 7. Store and load the newly created printer file. CREATE THE FORMAT FILE The next step is to create a file that contains the text of your briefing format, i.e., the company name/address and line numbers. This file will also include the formatting commands required to position the text on the page. 1. Create a new file. For example: Type: F5new brief.txt 2. Enter your formatting commands. For the sample page shown above, we used the following commands: TP 2 OF 10 FD 66 PL 66 RM 70 LM 0 AL 1 We also used the PT (Print Type) command associated with 8-point Times Roman. 3. Type in your company name and address, changing display modes as appropriate. 4. Change the offset command so that the line numbers will print to the left of the text. Depending on your style, you may also want to change the PT (Print Type) and line spacing. We used the PT associated with a 12-point Times Roman and also issued the following format commands. OF 0 TS 4R LL .75 The LL (Line Leading) command adds 3/4 line of space between each paragraph of text (in this case, each line number) that follows. (If you do not have Automatic Leading on, then use the LS command to adjust the line spacing.) The TS (Tab Set) command allows us to right align the one- and two-digit line numbers. 5. Enter the line numbers. Be sure to press the tab key before each number and press carriage return at the end of each line. (See Note #1.) 6. Cancel the LL command (LL 0,0) and restore the PT to the one you are using for the company name/address. 7. Enter an FR (Flush Right) command and then type your company name and address, changing modes as appropriate. 8. Store the file. 9. Use the TYPEF command to create a printer-ready version of the corporate format file. (See Note #2.) Type: F5typef brief.txt,brief.fmt Result: BRIEF.FMT is a printer-ready file that incorporates the PostScript commands from the printer file (BRIEF.PRN) with the formatting commands and text from the format file (BRIEF.TXT). TEST YOUR FORMAT Before proceeding, you should check your output to make sure you get the expected results. To test the file BRIEF.FMT that you created in the previous section: 1. Load your standard printer file. For example: Type: F5load 3post.prn 2. Create a new file and use the XyWrite IN (Include) command to incorporate the contents of BRIEF.FMT. Type: F5new brief.tst Type: F5in brief.fmt 3. Print the file. Type: F5type Result: The printer outputs a copy of the briefing format, with rules, company information, and line numbers in place. 4. Review the printed copy and, if needed, make adjustments to the formatting commands, text, or printer file. Refer to the previous sections for information on how to make these adjustments. For further information, refer to the XyWrite Reference Guide or the PostScript Language Reference Manual. 5. Abort BRIEF.TST. Type: F5ab 6. If you made any changes to either BRIEF.PRN or BRIEF.TXT, recreate BRIEF.FMT. Type: F5load brief.prn Type: F5typef brief.txt,brief.fmt 7. Repeat steps 1-6 until you are satisfied with the standard briefing format. INCORPORATE THE FORMAT INTO DOCUMENTS Once you have created a format sheet, you can easily incorporate it into your documents. 1. Make sure your standard printer file is loaded. 2. Call one of your documents to the screen. (See Note #3.) Type: F5call jones.brf 3. With the cursor at the beginning of the file, enter a Running Header command. Type: F5rh Result: A window opens in the middle of the screen. 4. Enter an IN (Include) command with the name of your printer-ready format file. Type: F5in brief.fmt 5. Enter a carriage return for each line in your company information block and for each blank line you want between the company information and the text of your document. 6. Close the screen. Press: F3 7. Type the document. Result: The printed copy includes the vertical lines from BRIEF.PRN and the text from BRIEF.TXT on every page, superimposed on the text of JONES.BRF. Note #1 Counters. You can use XyWrite's Counter (C#) command to enter the line numbers. Refer to the XyWrite Reference Guide for information on using counters. Note #2 TYPEF Filenames. You do not have to specify a name for the target file when you issue the TYPEF command (XyWrite will use the name FO.TMP). Because you will use this target file repeatedly, we recommend that you give it a specific name to avoid the possibility of overwriting it when you issue another TYPEF command. Note #3 Top Margin Command. Do not put a TP (Top Margin) command in your document files. The format file that you included in your document file already contains a TP command.