APPLICATION NOTE #137 PRINTING MULTIPLE COPIES ON A LASERJET Rev. 01 If you are using a Hewlett-Packard LaserJet, LaserJet Plus, or LaserJet II printer, you can set up a PC (Printer Control) table or use the PI (Printer Insert) command to define the number of copies you want to print. This application note gives you the information you need to use XyWrite to invoke the LaserJet's multiple copy command. LASERJET MULTIPLE COPY COMMAND If you want to print multiple copies of the same document, you can simply execute the TYPE command once for each copy. However, if you are printing a large number of copies of a small document, it is more efficient to use the LaserJet's multiple copy command, because your computer only has to process one request, leaving it free to go on to other tasks. The form of the LaserJet command is: {ESC}&InX where n is the number of copies you want to print. (See Note #1.) When the printer processes this command, it prints the specified number of copies of each page in the document, but it does not collate them. In other words, if you request 10 copies, the printer outputs 10 copies of page 1, then 10 copies of page 2, etc. Therefore, the command is most effective when used with small documents, such as memos and letters. USING THE PI (PRINTER INSERT) COMMAND PI is an embedded command that allows you to send a control string of up to 80 characters directly to the printer. Let's assume you want to print three copies of your memo: 1. Call the appropriate file to the screen. 2. Position the cursor at the start of the file. (See Note #2.) 3. Enter the PI command along with the LaserJet codes for printing 3 copies. Type: F5pi {ESC}&I3X Result: An embedded triangle marks the spot where you issued the command. When you TYPE your memo, your printer will output three copies of it. USING THE PC (PRINTER CONTROL) TABLE Like the PI command discussed above, the PC (Printer Control) command also allows you to send control strings directly to the printer. To use the PC command, you first define the control strings in a Printer Control table in the printer file and then reference them in the PC command. Suppose you always print out two copies of your letters, and five copies of your memos. You could set up a PC table so that line one contains the control string for printing 2 copies and line two contains the string for 5 copies. Then, to print multiple copies, you simply enter the PC command along with the line number of the string you want to send (e.g., PC 1 for 2 copies, PC 2 for 5 copies). Let's set up such a PC table. (XYQUEST provides several LaserJet printer files, and this procedure applies to all of them.) 1. Call the LaserJet printer file you are using. For example: Type: F5call 3hp-cart.prn 2. Move the cursor to the section of the printer file that contains the default commands (e.g., DF PL, DF FD, etc.). 3. Enter the PC table. (See Note #3.) Type: PC:2 Type: {ESC}X&l2X Type: {ESC}&l5X 4. Store and load the printer file. 5. Call your memo or letter to the screen. 6. Enter the appropriate PC command. Remember, the numbers in the PC command reference the appropriate lines in the PC table. Do not confuse these numbers with the quantity of copies you want. To print five copies of your memo: Type: F5pc 2 To print two copies of your letter: Type: F5pc 1 Note #1 Lowercase L. In the escape codes shown in this application note, the character after the ampersand is a lowercase L (ell). This is a required Hewlett Packard convention. If you type an uppercase L or the number 1 instead, the escape code will not work. Note #2 Command Placement. The LaserJet multiple copy command takes effect at the point it is placed in the text and stays in effect until the end of the document or until it is overridden. For example, if you place the PC or PI command on page 3 of a 5-page document, you will get multiple copies of only pages 3 through 5. Note #3 Editing a PC Table. A printer file can contain only one PC table, but that PC table can contain any number of lines. If your printer file already has a PC table, you can add the multiple copy control strings to it. Be sure to change the top line of the PC table to include the number of lines you add. Then determine the line numbers for the new control strings so that you specify the correct values in the PC command. Note #4 XyWrite III Users. PI (Printer Insert) is a XyWrite III Plus command. However, you can use the PC (Printer Control) function with the Hewlett Packard escape code to print multiple copies of your document. Note #5 More Information. For more information on the PI and PC commands, refer to the XyWrite Reference Guide. For more information on the LaserJet's control codes, refer to the documentation supplied with your printer.