APPLICATION NOTE #169 USING THE HP LASERJET IID PRINTER WITH XYWRITE Rev. 01 Related files: 3HP-IID.PRN, 3IID-CRT.PRN, 3IID-SFT.PRN, 3IID-SF1.PRN, 3IID-SF2.PRN, AUTO-ENV.PGM, AUTO-ENV.DOC, MAN-ENV.PGM, MAN-ENV.DOC This application note contains some tips for using a Hewlett-Packard LaserJet IID printer with XyWrite III Plus, Version 3.55. It addresses those questions most frequently asked of XYQUEST's Technical Support department regarding the LaserJet IID. LASERJET SERIES IID The LaserJet Series IID, manufactured by Hewlett-Packard, is a laser printer with 640K of memory, two slots for loading cartridge fonts, dual paper bins, and an optional envelope feeder. The S2 font cartridge comes with the printer, and font support is described in this application note. It is necessary to purchase extra memory boards for the printer to support the duplex printing feature described in this application note. (Hewlett-Packard recommends a 2 megabyte upgrade.) There are seven internal fonts: 10 pitch Courier, 10 pitch Courier bold, 10 pitch Courier Italic, 12 pitch Courier, 12 pitch Courier bold, 12 pitch Courier Italic, and Lineprinter. Each internal font supports six internal symbol sets: Roman 8 (8U), PC-8 (10U), PC-8 D/N (11U), PC-850 (12U), ECMA-94 Latin (0N), and Legal (1U). (Call Technical Support for a list of the available characters for each internal symbol set.) In standard printing (also called portrait printing), characters are printed across the 8-1/2-inch dimension of the page. In landscape printing, characters are printed across the 11-inch dimension of the page. The fonts described above exist only as portrait fonts. However, the HP LaserJet Series IID printer can automatically rotate fonts, so you can print your documents in either a portrait or a landscape page orientation. This characteristic doubles the number of available fonts. The control panel on the LaserJet Series IID provides a printing menu that allows you to set values for ten printing options. To use the XyWrite printer files described in this application note, be sure each of these options is set to its default value, as follows: No. of copies 01 Font Source I Font Number 00 Duplex OFF Tray BOTH Paper LETTER Orientation P Form 60 LINES Manual feed OFF Sym Set ROMAN-8 FORM DEPTH The LaserJet IID printer does not allow you to access the entire width and length of a sheet of paper. It "steals" about 1/2 inch from both the top and bottom margins and about 1/4 inch from the left and right margins. This means you have to adjust the LM (Left Margin) and FD (Form Depth) commands embedded in your document accordingly. For example, to get a 1-inch left margin, set the LM command to 8 (rather than the standard LM 10). The cumulative loss at the top and bottom margins means you cannot get more than 60 lines on a standard 8-1/2 x 11 sheet of paper. Therefore, we have set FD (Form Depth) to 60 in the LaserJet IID printer files. THE IID PRINTER FILES The IID printer files contains a PC (Printer Control) table, described in the chart below, that enables you to access various paper trays, initiate duplex printing, and print fonts in either a portrait or a landscape orientation. Normally, you use the PC command to invoke PC codes at a particular point in your text file. However, since the LaserJet IID has multiple paper trays, PC codes that select a specific tray conflict with the TP and RH commands. Therefore, XYQUEST has developed the PB (Page Begin) command to send control strings that select trays on HP LaserJet IID printer. The PB command has the format: PB # # is the row number in the PC Table corresponding to the control string you want to send. (See chart at end.) PB is an embedded command. Since it affects the page orientation (portrait or landscape), you must enter the PB command before any text or any PT (Print Type) commands. Also, enter the command before the page it is to affect. For example, in a multi-page document, enter the PB command on the same line as the PG (Page Break) command, and then enter a carriage return. The PB command overrides any previous PB command in the file. For example, to print an envelope from the automatic envelope feeder immediately after printing a letter from the upper paper tray, your PB and PT commands should look like this: <><>This is a letter that is to be followed by a printed envelope from the automatic envelope feeder.<><> <><>name address city Result: Your letter is printed in a portrait page orientation from the upper paper tray in the font associated with PT 4. The letter is followed by an envelope from the automatic envelope feeder printed in the same font but in landscape orientation. You do not have to use the PB command to access all PC codes. In many cases you can still use the PC command (for example, to draw a rule across the middle of the paper using HP raster graphics commands). CUSTOMIZING PRINTER FILES FOR BOTH SOFT FONTS AND FONT CARTRIDGES The XyWrite printer files fully support the internal fonts with all the internal symbol sets and the S2 font cartridge. Use the following procedure to customize the printer file for both soft fonts and font cartridges. (If you have a customized printer file already developed for use with the LaserJet IID printer, see Note #1.) If you want to use a combination of soft font and font cartridges, as well as the IID internal fonts, you can find the soft font or the cartridge information in one of the four available printer files listed below: File Supports 3IID-CRT.PRN All font cartridges 3IID-SFT.PRN AC/AD/AE/AF soft fonts 3IID-SF1.PRN DA/EA/RA soft fonts 3IID-SF2.PRN SA/TA/UA soft fonts 1. Copy the font definition, width table, and substitution table (if needed) from the appropriate printer file into your customized printer file. It is not necessary to copy the substitution table if it already exists in the file you are working with. The following is an example of a font definition, width table, and substitution table for the F cartridge font, 10 point Times Roman: FO:F*10TIMES FO<{esc}(8U{esc}(s1p10v0s0b5T VL=50 UW:F*10TIMES US:Roman8 ET WD:F*10TIMES SW=30 . . ET SU:Roman8 ø=³ . . ET 2. Create a PT Table that accesses the new fonts. (Refer to Application Note #162.) 3. Store and load the printer file. Make sure there are no error messages. Note #1 Existing Customized Printer File. Because the print head of the IID printer rotates to allow any internal, cartridge, or soft font to be printed in either a portrait or a landscape orientation, the section of the font definition that normally specifies the orientation has been removed and included in the PC strings for more flexibility. If you have already developed a customized printer file for use with the LaserJet IID printer, you must remove the orientation from the font definition in order to use customized fonts with the IID printer PC codes. To do this, go to the line that begins FO< and remove the string, {esc}&l0O. (If the font is a landscape font, the string you remove is &l1O.) The complete line now looks something like this: FO<{esc}(8U{esc}(s1p10v0s0b5T Also, make sure you copy the PC Table from the IID printer file into your customized printer file and delete any existing PC Table. The font can now be printed in either portrait or landscape orientation when used in combination with the proper PB command (see the previous table). For more information, see "Landscape Printing" below. LANDSCAPE PRINTING Landscape printing (characters printed across the 11-inch dimension of the page) is useful when printing a spreadsheet document with many snaked columns or an envelope. The LaserJet IID printer allows you to print your documents in either portrait or landscape orientation, but does not allow you to mix portrait and landscape orientations on the same page. (see Note #2.) To activate landscape printing, select a PC number from the table on Page 2 that accesses landscape printing as well as the paper size and tray you want to use. Use the PB command to access the PC code before the PT (Print Type) command. For example, to print a document on paper from the upper paper tray, using PT1 in a landscape page orientation: At the beginning of the file Type: F5pb 2 Type: F5pt 1 Result: When you type the document, the font specified by PT1 is printed in a landscape orientation on paper fed from the upper paper tray. The XyWrite default settings in the IID printer files are based on portrait printing. To use landscape printing effectively with these files, you must override the PL (Page Length), FD (Form Depth), and RM (Right Margin) default settings. To take advantage of the full width of the landscape orientation, you should also adjust your right margin. (When landscape printing, the right margin can be up to 105.) 1. Call your document to the screen. Type: F5call chapter.doc 2. Enter the formatting commands to set the form depth, page length, and right margin for the landscape page orientation. Type: F5fd 45 Type: F5pl 42,44,40 Type: F5rm 100 3. Enter the rest of the formatting commands. Don't forget to include a PB command and a PT (Print Type) command that reference the font you want to use. Result: Your document is now ready for landscape printing. Note #2 Mixing Portrait and Landscape Fonts Within a Document. Although you cannot mix portrait and landscape printing on the same page, you can mix them on different pages of the same document. If you plan to do this, use the appropriate PB command followed by a PG command and a carriage return. PRINTING ON ENVELOPES Envelope printing is a form of landscape printing. As described in the previous section, you need to override some default settings (such as TP, PT, FD, PL, LM, RM, etc.) You also need to send a command string to the printer to set it up for envelope printing. The PC Table defines the required printer commands for several different envelopes: Standard 8-1/2 x 11 Tray PC11 Manual-feed envelopes HP Envelope Tray Used with IID Automatic Envelope Feeder PC12 Feed Standard #10 envelope from the HP envelope tray in the lower paper tray position IID Automatic Envelope Feeder PC7 Standard #10 envelope PC8 Monarch size envelope PC9 DL size envelope PC10 C5 size envelopes To print an envelope: 1. Create a new file. Type: F5new envelope 2. Use the PB command to embed the correct PC number for the envelope tray or the size envelope you are using (11 for the manual-feed standard letter tray; 7, 8, 9, or 10 for the automatic envelope feeder; 12 for the HP envelope tray with the automatic envelope feeder attached to the IID. Refer to the table on Page 2.) For example: Type: F5pb 7 When you TYPE the file, the PC code accessed by the PB command adjusts the printer to accommodate either the size of the envelope or the paper tray being used. The printer will prompt you either to manually feed the envelope from the standard 8-1/2 x 11 tray or with the envelope size it is expecting from either the automatic envelope feeder or the HP envelope tray. 3. Embed the necessary formatting commands. Automatic Envelope Feeder or the HP Envelope Tray. The following list is an example of the formatting commands you might use if you were going to print on a standard #10 envelope from the automatic envelope feeder: PB 7 TP 10 LM 35 PT 5 Manually Feed from Standard 8-1/2 x 11 Tray. The following list is an example of the formatting commands you might use if you were going to manually feed envelopes from the standard 8-1/2 x ll tray: PB 11 TP 20 FD 45 PL 42,44,40 LM 52 RM 120 PT 5 If you are using the IID manual feed slot, set the paper guides so that the envelope feeds through the center. Insert the envelope face up, stamp end first, into the printer. 4. Enter the name and address you want to print on the envelope. Following the example above for printing on #10 envelopes from the automatic envelope feeder, your completed file should look something like this in expanded mode: <><><><> Catherine Cross 44 Manning Park Billerica, MA 01821 5. Type: F5type Automatic Envelopes XYQUEST has created a program that lets you print an envelope to go with your letter without retyping the name and address. This program uses two of the four available files: * AUTO-ENV.DOC for feeding standard commercial #10 envelopes from the automatic feeder or from the HP envelope tray * MAN-ENV.DOC for manually feeding standard commercial #10 envelopes from the standard letter tray * AUTO-ENV.PGM * MAN-ENV.PGM These files are included in the HP LaserJet IID printer file package. Note #3 Printer Control Codes. AUTO-ENV.DOC and MAN-ENV.DOC are set up to access Printer Control strings in IID printer files. If you changed the order of these strings, you must change the PB and PT commands in the envelope files that correspond to the printer control string and the font you want to use. To use the program: 1. Call your letter to the screen. Be sure the address block ends with two carriage returns. 2. Place your cursor on the first character of the addressee's name. 3. Run the program (either AUTO-ENV.PGM or MAN-ENV.PGM). For example: Type: F5run auto-env.pgm Result: The program defines the address block (starting with the character under the cursor and ending with two carriage returns). It then copies the defined text into Save/Get E, enters the contents of Save/Get E into its corresponding file (AUTO-ENV.DOC or MAN-ENV.DOC), and sends that file to the printer. Note #4 Changing the Save/Get Key. If you are using Save/Get E for another purpose, you can have AUTO-ENV.PGM, MAN-ENV.PGM, or their matching .DOC files use a different Save/Get. Both programs assume that its matching .DOC file is in the current directory. If it isn't, call either AUTO-ENV.PGM or MAN-ENV.PGM to the screen, move the cursor to the TY command, and add the path name to the filename specification. Refer to the programming section in Chapter 5 of the XyWrite III Plus Reference Guide for information on changing program files. Using Mail Merge to Print Envelopes You can use XyWrite's Mail Merge capability to print a series of envelopes as follows. 1. Create the data file and enter the names and addresses on your mailing list. Be sure to use two carriage returns to separate each address. 2. Create the main file by following steps 1 through 4 under "Printing on Envelopes." 3. Type the appropriate FI and PF statements, followed by a PG (Page Break) command. When in expanded mode, your completed file should look like this: <><><><> <> <> <>, <> <> <> Result: You now have a standard envelope format file (main file) that feeds #10 standard envelopes from the automatic envelope feeder and that you can use with different mailing lists (data files.) 4. Store the file and then send it to the printer. Type: F5st Type: F5type datafile+mainfile Note #5 Suppressing Printer Error Messages. While using the Mail Merge capability to print a series of manually fed envelopes, you may continually receive a printer error message on the prompt line. (The message indicates that the printer is waiting for you to put another envelope in the printer slot.) You can suppress the message and its corresponding beep as follows: Type: F5default NE=1 However, this disables all printer error messages until you either reboot the system or reset the default (default NE=0). PRINTING ON LEGAL-SIZED PAPER If you want to print on legal-sized paper (using the standard 8-1/2 x 11 tray), you must enter the appropriate PB command as well as make other modifications to the document. 1. Call your document to the screen. 2. Use the PB command to embed the correct PC number to print on manually fed legal-sized paper in either a portrait or a landscape orientation (5 is for portrait printing; 6 is for landscape printing). Portrait Printing. If you want to use portrait printing, enter the following commands at the beginning of the document. Type: F5pb 5 Type: F5fd 78 Type: F5pl 74,76,72 Landscape Printing. If you want to use landscape printing, enter the following commands at the beginning of the document. Type: F5pb 6 Type: F5fd 45 Type: F5pl 42,44,40 Type: F5rm 130 3. Type your document. Type: F5type DUPLEX PRINTING If you want to use the duplex printing feature of the LaserJet IID printer, you must modify your document to include the appropriate PB command setting. 1. At the beginning of the file, use the PB command to embed the correct PC number for the paper tray and the page orientation you want to use. For example: Type: F5pb 13 2. Embed the necessary formatting commands. 3. At the beginning of the next line: Type: F5pb (It is necessary to enter the PB command without an argument so that the printer will not attempt to restart duplex printing each time it encounters a page break from XyWrite.) Result: The document will be printed double-sided in the long-edge binding format on paper fed from the upper paper tray in portrait page orientation. USING SPECIAL CHARACTERS In the 3HP-IID.PRN printer file, each of the seven internal fonts support six internal symbol sets: Roman 8 (8U), PC-8 (10U), PC-8 D/N (11U), PC-850 (12U), ECMA-94 Latin (0N), and Legal (1U). Each font has been assigned a specific name in the format font-symbolset. For example, the name of the 12-pitch Courier font that uses the 10U (PC-8) symbol set is 12-COURIER-10U; the same 12-pitch Courier font that uses the 8U (Roman 8) symbol set is 12COURIER-8U, etc. The ASCII characters 32 through 126 print the same for each symbol set. Characters 1 through 31 print using the 10U, 11U, and 12U symbol sets with the PCSYMBOL substitution table. Characters 127 through 255 print depending on the specific symbol set you are using. USING THE S2 FONT CARTRIDGE When you use the S2 cartridge, you have the option of accessing five different proportional fonts, each with 4 symbol sets. The 3HP-IID.PRN printer file reorganizes the fonts and symbol sets as S2*14HELVB-10U Proportional, 14 point S2*12TR-10U Proportional, 12 point S2*12TRB-10U Proportional, 12 point S2*12TRI-10U Proportional, 12 point S2*8TR-10U Proportional, 8 point S2*14HELVB-11U Proportional, 14 point S2*12TR-11U Proportional, 12 point S2*12TRB-11U Proportional, 12 point S2*12TRI-11U Proportional, 12 point S2*8TR-11U Proportional, 8 point Since 3HP-IID.PRN reorganizes the four S2 cartridge symbol sets into two sets, only two font definitions are needed for each font. For a list of the characters available with each font, call Technical Support. The set named PC-8 (10U) contains all the PC-8 (10U) characters plus certain characters from the ECMA-94 Latin (0N) set. The ECMA substitution table provides access to these characters. Use the S2 font definitions which haveÿ2D10U appended to them (S2*name-10U), for example, S2*14HELVB-10U or S2*12TRI-10U. The set named 11U contains all the PC-8 Danish/Nor~wegian (11U) characters, several of the ECMA-94 (0N) characters, and two characters from the Roman8 (8U) set. The LATIN substitution table provides access to these characters. Use the S2 font definitions which have ÿ2D11U appended to them (S2*name-11U), for example, S2*14HELVB-11U or S2*12TRI-11U. Note #6 Lowercase L. In all the escape codes shown in this application note, the character after the ampersand is a lowercase L (ell). __________________________________________________ PC TABLE PC # Size Tray Orientation 1 Letter (8-1/2 x 11) Upper Portrait 2 Letter (8-1/2 x 11) Upper Landscape 3 Letter (8-1/2 x 11) Lower Portrait 4 Letter (8-1/2 x 11) Lower Landscape 5 Legal (8-1/2 x 14) Lower (manual feed) Portrait 6 Legal (8-1/2 x 14) Lower (manual feed) Landscape 7 Std #10 envelope Auto. env. feeder Landscape 8 Monarch envelope Auto. env feeder Landscape 9 International DL Auto. env. feeder Landscape 10 International C5 Auto. env. feeder Landscape 11 Manual feed env. Landscape 12 Std #10 envelope HP envelope tray** Landscape 13 Letter/Long-edge bind.* Upper Portrait 14 Letter/Long-edge bind.* Lower Portrait 15 Letter/Long-edge bind.* Upper Landscape 16 Letter/Long-edge bind.* Lower Landscape 17 Letter/Short-edge bind.* Upper Portrait 18 Letter/Short-edge bind.* Lower Portrait 19 Letter/Short-edge bind.* Upper Landscape 20 Letter/Short-edge bind.* Lower Landscape * 8-1/2 x 11. Long- and short-edge binding are described in detail in your LaserJet IID technical reference manual. ** Feed envelopes from the HP envelope tray in the lower paper tray position.