APPLICATION NOTE #195 USING THE HP LASERJET IIID PRINTER WITH XYWRITE III PLUS Rev. 01 This application note contains some tips for using a Hewlett-Packard LaserJet IIID printer with XyWrite III Plus, Version 3.55 or later. It addresses those questions most frequently asked of XYQUEST's Technical Services Department regarding the LaserJet IIID. LASERJET IIID The LaserJet IIID, manufactured by Hewlett-Packard, is a dual-tray/duplexing desktop laser printer with 1 megabyte of base memory (720K of user memory at powerup). It combines the paper handling benefits of the LaserJet IID (dual paper trays/optional envelope feeder) with the increased functionality of the LaserJet III. (An extra memory board is required to support the duplex printing described in this application note, i.e., you need 2 megabytes of memory.) The LaserJet IIID has seven bit-mapped internal fonts: 10- and 12-pitch Courier, Courier Bold, and Courier Italic, and 17-pitch Line Printer. Each can print in both portrait and landscape orientation, for a total of 14 bit-mapped internal fonts. Additionally, the printer has eight scalable internal typefaces: CG Times, CG Times Bold, CG Times Italic, CG Times Bold Italic, Univers Medium, Univers Bold, Univers Italic, and Univers Bold Italic. Each can be scaled to any point size between 1 and 999.75 in quarter-point increments, and printed in either portrait or landscape orientation. The internal bit-mapped fonts support 26 symbol sets. The internal scalable typefaces support the same 26, plus 10 others: Ventura Math (6M), Ventura International (13J), Ventura US (14J), PS Math (5M), PS Text (10J), Math 8 (8M), PiFont (15U), Microsoft Pub (6J), Windows (9U), and Desktop (7J). The most common symbol sets are Roman 8 (8U), PC-8 (10U), PC-8 D/N (11U), PC-850 (12U), Desktop (7J), Legal (1U), and ECMA-94 Latin (0N). (The table at the end of this application note displays the characters available for these symbol sets.) The printer files are set up as follows: 3IIID8U.PRN Scalable fonts in 8U symbol set; bit-mapped fonts in 10U and 8U sets. 3IIID10U.PRN Scalable fonts in 10U symbol set; bit-mapped fonts in 10U and 8U sets. 3IIID7J.PRN Scalable fonts in 7J symbol set; bit-mapped fonts in 10U and 8U sets. Because of memory constraints, the printer files contain font definitions for a limited number of sizes and symbol sets. However, you can easily modify the printer files to use the fixed-pitch, bit-mapped fonts in any of the 26 symbol sets; the scalable fonts require some testing to justify properly in other sizes and symbol sets. See "Using Other Symbol Sets." The control panel on the LaserJet IIID provides a printing menu that allows you to set values for nine printing options. However, for XyWrite to effectively control the printer, these options must be established with XyWrite commands. Therefore, you need to set each of the printer options 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 A secondary menu on the control panel allows you to select the level of Resolution Enhancement Technology you want and to turn Page Protection on or off. These settings do not affect XyWrite; therefore, you can select the levels that best suit your printing needs. FORM DEPTH The LaserJet IIID 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 IIID printer files. THE PC (PRINTER CONTROL) TABLE The LaserJet IIID printer files contain a PC (Printer Control) table, described below, that enables you to access various paper trays and select either portrait or landscape orientation. _____________________________________________________________________ _______ # Code Explanation Tray Orient 1 &l2A&l1H&l0O Letter (8-1/2 x 11) U P 2 &l2A&l1H&l1O Letter (8-1/2 x 11) U L 3 &l2A&l4H&l0O Letter (8-1/2 x 11) L P 4 &l2A&l4H&l1O Letter (8-1/2 x 11) L L 5 &l3A&l2H&l0O Legal (8-1/2 x 14) L (manual) P 6 &l3A&l2H&l1O Legal (8-1/2 x 14) L (manual) L 7 &l81A&l6H&l1O Standard #10 envelope Env. feed L 8 &l80A&l6H&l1O Monarch envelope (7-3/4) Env. feed L 9 &l90A&l6H&l1O International DL Env. feed L 10 &l91A&l6H&l1O International C5 Env. feed L 11 &l3H&l1O Manual feed envelopes L 12 &l81A&l4H&l1O Standard #10 envelope Env. tray** L 13 &l2A&l1H&l1S&l0O Letter/Long-edge bind.* (8-1/2 x 11) U P 14 &l2A&l4H&l1S&l0O Letter/Long-edge bind.* (8-1/2 x 11) L P 15 &l2A&l1H&l1S&l1O Letter/Long-edge bind.* (8-1/2 x 11) U L 16 &l2A&l4H&l1S&l1O Letter/Long-edge bind.* (8-1/2 x 11) L L 17 &l2A&l1H&l2S&l0O Letter/Short-edge bind.* (8-1/2 x 11) U P 18 &l2A&l4H&l2S&l0O Letter/Short-edge bind.* (8-1/2 x 11) L P 19 &l2A&l1H&l2S&l1O Letter/Short-edge bind.* (8-1/2 x 11) U L 20 &l2A&l4H&l2S&l1O Letter/Short-edge bind.* (8-1/2 x 11) L L *Long- and short-edge binding are described in detail in the LaserJet IIID technical reference manual. **Feed envelopes from the HP envelope tray in the lower paper tray position. _____________________________________________________________________ _________ Normally, you use the PC command to invoke PC codes at a particular point in your text file. However, PC codes that select a specific tray conflict with the TP and RH commands. To solve this problem, XYQUEST developed the PB (Page Begin) command. PB is used instead of PC to send control strings that select the paper tray on the LaserJet IIID printer (see Note #1). 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 table below.) 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. 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 Note #1 PC Codes. You do not have to use the PB command to access all PC codes, only those that select paper trays. For example, you can develop an additional PC string to draw a rule across the middle of the paper using HP raster graphics commands. If you add that string to the PC table, you can access it with the PC command. ADDING SOFT FONTS AND FONT CARTRIDGES TO THE PRINTER FILES The XyWrite printer files fully support the internal fonts. You can customize them to support both soft fonts and font cartridges. (If you have a customized printer file already developed for use with the LaserJet IIID printer, see Note #2.) The printer files we have developed for the HP LaserJet IID can also be used with the LaserJet IIID to provide the font definitions and width tables for all soft fonts and cartridges. The IID printer files and the fonts supported by each are 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 3HP-IID.PRN S1 and S2 cartridges To add a font to a LaserJet IIID printer file: 1. Copy the font definition, width table, and substitution table (if needed) from the appropriate IID printer file into your LaserJet IIID 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 (1), width table (2), and substitution table (3) for the F cartridge font, 10 point Times Roman: FO:F*10TIMES FO<(8U(s1p10v0s0b5T VL=50 1 UW:F*10TIMES US:Roman8 ET WD:F*10TIMES SW=30 . 2 . ET SU:Roman8 ø=³ . 3 . ET 2. Create a PT Table that accesses the new font. (Refer to Application Note #162.) 3. Store and load the printer file. Make sure there are no error messages. Note #2 Existing Customized Printer File. Because the LaserJet IIID printer can manipulate any internal, cartridge, or soft font to allow printing in either portrait or landscape orientation, the section of the font definition that normally specifies the orientation has been removed and included in the PC strings. If you have already developed a customized printer file for use with the LaserJet IIID printer, remove the orientation codes from the font definitions if you plan to use the PC codes. To do this, go to the line that begins FO< and remove the string, &l0O. (If the font is a landscape font, the string you remove is &l1O.) The complete line should look something like this: FO<(8U(s1p10v0s0b5T Also, make sure you copy the PC Table from the LaserJet IIID 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 In standard printing (also called portrait printing), characters are printed across the 8.5-inch dimension of the page. In landscape printing, characters are printed across the 11-inch dimension of the page. Landscape printing is useful when printing a spreadsheet, a document with many snaked columns, or an envelope. The LaserJet IIID printer allows you to print your documents in either portrait or landscape orientation, and mix portrait and landscape orientations on the same page (see "Mixing Portrait and Landscape Printing on a Page."). To activate landscape printing, select the PC number from the table on Page 2 that accesses landscape orientation as well as the paper size and tray you want to use. In your document, embed the PB command to access this PC code. Enter the PB command before the PT (Print Type) command. For example, to print a document on paper from the standard 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 8.5- by 11-inch paper fed from the standard paper tray. The XyWrite default settings in the LaserJet IIID printer files are based on portrait printing. To use landscape printing effectively with these files, you must override the PL (Page Length) and FD (Form Depth) 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 any other formatting commands you need. Don't forget to include a PB command and a PT (Print Type) command that reference the PC code and font you want to use. Result: Your document is now ready for landscape printing. MIXING PORTRAIT AND LANDSCAPE FONTS ON A PAGE The LaserJet IIID's print direction command allows you to switch the print orientation without ejecting a page. With this command, you can print text in four different directions: 0 degrees (portrait); 90 degrees (landscape); 180 degrees (reverse portrait); and 270 degrees (reverse landscape). The print direction command always measures the print orientation relative to 0 degrees (portrait). The four print direction commands, which you issue inside a PI (Printer Insert) command, are: Command Effect Orientation &a0P Print 0 degrees Portrait &a90P Print 90 degrees Landscape &a180P Print 180 degrees Reverse portrait &a270P Print 270 degrees Reverse landscape When you change orientation on a page, the baseline of the last printed character becomes the starting point for the new direction of text. Let's take a look at an example. The following combination of text and PI commands: zero degrees _<>90 degrees _ <>180 degrees _<>270 degrees produces a "box" of text. * Notice that the sample input contains only the single carriage return at the end. If you add carriage returns before each PI command, the starting point for the new direction returns to the left edge of the paper. If that happens, reverse portrait and reverse landscape cannot print. You can use the print direction command to print mirrored text too. For example, the following combination of text and commands: Timid<>dimiT produces the word "Timid" and its mirror image. 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 IIID Automatic Envelope Feeder PC12 Feed Standard #10 envelope from the HP envelope tray in the lower paper tray position IIID 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 IIID. (Refer to the table above.) 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 IIID 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 IIID printer file package. Note #3 Printer Control Codes. AUTO-ENV.DOC and MAN-ENV.DOC are set up to access Printer Control strings in IIID 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 programming Save/Get 01, includes the contents of Save/Get 01 in its corresponding file (AUTO-ENV.DOC or MAN-ENV.DOC), and sends that file to the printer. Note #4 Modifying the Envelope Programs. Both the AUTO-ENV.PGM and MAN-ENV.PGM programs assume that their 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 IIID 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 OTHER SYMBOL SETS In the three LaserJet III printer files, each of the font definitions for the bit-mapped internal fonts supports two internal symbol sets: Roman-8 (8U) and PC-8 (10U). PC-8 is the default symbol set. To use Roman-8 instead: 1. Call the printer file to the display. 2. Search for the standard internal font table. Type: F5se /internal fonts set/ 3. There are two lines which begin FO<. Place a semicolon at the beginning of the line that includes (10U. Remove the semicolon from the beginning of the line that includes (8U. 4. There are two lines that begin US:. Place a semicolon at the beginning of the line which reads US:PCSYMBOL and remove the semicolon from the beginning of the line which reads US:8U-SUB. 5. Store and load the printer file. To use any other symbol set, replace the 10U with the designator of the symbol set you want. Place a semicolon at the beginning of the US:8U-SUB line. Using a different symbol set with one of the scalable typefaces takes a bit more work. Because these typefaces are proportionally spaced, each character has a different width in different symbol sets and requires that you modify the width table. Application Note #123 discusses testing character widths. The ASCII characters 32 through 126 produce the same printed output for each symbol set. Characters 1 through 31 print the 10U, 11U, and 12U symbol sets with the PCSYMBOL substitution table. The printed output of characters 127 through 255 print varies, depending on the specific symbol set you are using. ###