APPLICATION NOTE #192 USING THE HP LASERJET III WITH XYWRITE III PLUS Rev. 01 This application note contains some tips for using a Hewlett-Packard LaserJet III 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 III. LASERJET III The LaserJet III, manufactured by Hewlett-Packard, is a laser printer with 1 megabyte of base memory (720K of user memory at powerup). The LaserJet III 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). (A printed copy of the characters available for these symbol sets in available on request.) The printer files are set up as follows: 3LJ3-8U.PRN Scalable fonts in 8U symbol set; bit-mapped fonts in 10U and 8U symbol sets. 3LJ3-10U.PRN Scalable fonts in 10U symbol set; bit-mapped fonts in 10U and 8U symbol sets. 3LJ3-7J.PRN Scalable fonts in 7J symbol set; bit-mapped fonts in 10U and 8U symbol 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 III 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: COPIES 1 FONT SRC I (internal) FONT NUM 0 PAPER Letter ORIENT P FORM 60 LINES MAN 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 III 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 III printer files. THE PC (PRINTER CONTROL) TABLE The LaserJet III 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. # PC Code Explanation Orientation 1 &l2A&l1H&l0O Letter (8.5x11) from letter tray Portrait 2 &l2A&l1H&l1O Letter (8.5x11) from letter tray Landscape 3 &l2A&l2H&l0O Letter (8.5x11) manually fed from letter tray Portrait 4 &l2A&l2H&l1O Letter (8.5x11) manually fed from letter tray Landscape 5 &l3A&l2H&l0O Legal (8.5x14) manually fed from letter tray Portrait 6 &l3A&l2H&l1O Legal (8.5x14) manually fed from letter tray Landscape 7 &l3H&l1O Manually fed envelopes, letter tray Landscape 8 &l81A&l1O Comm. envelope #10, envelope tray Landscape 9 &l80A&l1O Comm. envelope #7-3/4 (Monarch), env. tray Landscape 10 &l90A&l1O International DL from HP envelope tray Landscape 11 &l91A&l1O International C5 from HP envelope tray Landscape NOTE: In the PC codes listed above, the character after the ampersand is a lowercase L, not a one; and the last character is an uppercase O, not a zero. 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 III 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 the first page of a file in landscape orientation and the second page in portrait orientation, both fed from the multi-purpose tray, your PB and PG commands should look like this: <><><><>This is page 1, landscape orientation. This is the second line. <><> <><><>This is page two, portrait orientation. See "Landscape Printing" for more information. 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 III printer, see Note #2.) The printer files we have developed for the HP LaserJet IID can also be used with the LaserJet III 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 III printer file: 1. Copy the font definition, width table, and substitution table (if needed) from the appropriate IID printer file into your LaserJet III 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<(8U(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 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 III 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 III 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 III 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 III 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 III 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 III'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 earlier, you need to override some default settings (such as TP, 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 PC7 Manually feed envelopes from standard paper tray Optional Envelope Tray PC8 Feed standard #10 envelope from envelope tray PC9 Feed International Monarch envelope from envelope tray PC10 Feed International DL from envelope tray PC11 Feed International C5 from envelope tray 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 and the size envelope you are using. For example: Type: F5pb 7 When you TYPE the file, the PC code accessed by the PB command adjusts the printer to accommodate the paper tray being used. The printer prompts you to manually feed the envelope from the appropriate tray. 3. Embed the necessary formatting commands. 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 envelope tray: PB 8 TP 8 LM 40 RM 90 PT 5 Manually Fed from the Standard 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 tray: PB 7 TP 20 FD 45 PL 42,44,40 LM 52 RM 90 PT 5 If you are using the standard tray, set the paper guides so that the envelope feeds properly. Insert the envelope face up, stamp side 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 letter tray, 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 files: LJ3-ENV.DOC and LJ3-ENV.PGM. These files are included in the HP LaserJet III printer file package. Note #3 Printer Control Codes. LJ3-ENV.DOC is set up to access Printer Control strings in the LaserJet III printer files. If you change 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 is followed by two extra returns. 2. Place your cursor on the first character of the addressee's name. 3. Run the program: Type: F5run lj3-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 (in this case, LJ3-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 use a different Save/Get for LJ3-ENV.PGM and LJ3-ENV.DOC. Call the program file to the screen and locate the bold function call SV. Change the letter that follows it to the alphanumeric key you prefer this program to use. Then call the file LJ3-ENV.DOC and change the letter following the IS: to the same alphanumeric key. The program assumes that LJ3-ENV.DOC is in the current directory. If it isn't, call LJ3-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." (Omit the FD and PL formatting commands.) 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 envelopes manually from the standard paper tray. You can use this format file 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 paper 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 code 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 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. ###