APPLICATION NOTE #198 USING THE HP DESKJET 500 WITH XYWRITE III PLUS The DeskJet 500, manufactured by Hewlett Packard, is an inkjet printer that supports cartridge and soft fonts. XYQUEST has developed printer files that enable you to use the DeskJet 500 printer with XyWrite III Plus, Version 3.55 or later. This application note describes the DeskJet 500 printer files, gives instructions for modifying them, and provides detailed instructions on how to print your documents in landscape orientation and on envelopes. PRINTER FILES There are two files included in the DeskJet 500 printer file package. These files support the internal fonts and the new C2109D (Dom Casual) and C2109E (Brush) cartridges. 3DJ5-10U.PRN Ä Supports all internal fonts in the PC-8 (10U) character set and the new C2109B, C2109C, C2109D and C2109E cartridges in the ECMA-94 (0N) character set. 3DJ5-8U.PRN Ä Supports all internal fonts in the Roman8 (8U) character set and the new C2109D and C2109E cartridges in the ECMA-94 (0N) character set. Monospaced Font Names The DeskJet 500's monospaced fonts have two fixed values: Point Size (character height) Pitch (characters per inch) XyWrite's font names for monospaced fonts have the form: pointsize/pitchFONTNAME For example, a font containing 12-point Courier type that prints 10 characters per inch is named: 12/10CO Form Depth The DeskJet 500 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 ac~~cord~~ingly. 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 DeskJet 500 printer files. PC Tables Each DeskJet 500 printer file contains a PC (Printer Control) table that allows you to access four different paper sizes and print certain fonts in either portrait or landscape orientation (see ``Landscape Printing''). The PC table is described below. PC # PC Code Size Orient. 1 &l2A&l0O Letter (8-1/2 x 11) Portrait 2 &l2A&l1O Letter (8-1/2 x 11) Landscape 3 &l3A&l0O Legal (8-1/2 x 14) Portrait 4 &l3A&l1O Legal (8-1/2 x 14) Landscape 5 &l26&l0OA A4 (European) Portrait 6 &l26&l1OA A4 (European) Landscape 7 &l81&l0OA #10 Envelope Portrait Normally, you use the PC command to invoke PC codes at a particular point in your text file. However, the DeskJet 500 processes PC codes in a way that conflicts with the TP and RH commands. Therefore, XYQUEST has developed the PB (Page Begin) command to change the way control strings are sent from PC tables. PB is an embedded command and has the format: pb # where # is the line number in the PC table that cor~re~spond~s to the control string you want to send. For example, to print on legal-sized paper: Type: F5pb 3 The PB command must be entered before the page it is to affect, which means that in a multi-page document it immed~i~ate~ly precedes the PG (Page Break) command. For more information on using the PB command, refer to the procedure for the specific task you want to perform. Note #1 Lowercase L. In all escape codes shown in this application note, the character after the ampersand is a lowercase L. MODIFYING DESKJET 500 PRINTER FILES The printer files delivered with the DeskJet 500 package are all set to go. Each file contains PT tables for the most commonly use fonts. All you need to do is select the one you want and load it into memory with the LOAD command. Keep in mind, however, that the DeskJet 500 offers several options. You may want to modify the standard printer files to incorporate one or more of these options. The following sections give you the information you need to add a PT table and to change the underline type, print quality, and character set. Remember to store and load the printer file every time you make a change. For more information on modifying printer files, refer to Chapter 6 of the XyWrite III Plus Reference Guide. 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. The printer files developed for the HP DeskJet Plus can also be used with the DeskJet 500 to provide the font definitions and width tables for all soft fonts and cartridges. The DeskJet Plus printer files and the fonts supported by each are listed below. The printer files are available from Technical Services. File Supports 3DJ-PLS1.PRN the R, T, U, and V cartridges and HP 22708C soft fonts in the PC-8 (10U) character set 3DJ-PLS2.PRN the R, T, U, and V cartridges and the HP 22708C soft fonts in the Roman8 (8U) character set 3DJ-PLS3.PRN the HP 22708D soft fonts in the PC-8 (10U) char~ac~ter set 3DJ-PLS4.PRN the HP 22708D soft fonts in the Roman8 (8U) char~ac~ter set 3DJ-PLS5.PRN the A, B, C, and M cartridges 3DJ-PLS6.PRN the G, H, J, and Q cartridges 3DJ-PLS7.PRN the D, E, F, and P cartridges To add a font to a DeskJet 500 printer file: 1. Copy the font definition, width table, and substitution table (if needed) from the appropriate DeskJet Plus printer file into your DeskJet 500 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 R cartridge font, 10 point Times Roman: FO:10TIMES FO<(8U(s1p10v0s0b5T VL=50 UW:10TIMES US:PCSymbol ET WD:10TIMES SW=30 . . ET SU:PCSymbol ø=³ . . ET 2. Create a PT Table that accesses the new font. (Refer to ``Creating a New PT Table.'') 3. Store and load the printer file. Make sure there are no error messages. Creating a New PT Table PT (Print Type) tables enable XyWrite to actually use the fonts that are written into the file. The PT table numbers correspond to the value you use with the PT formatting command. For example, when you issue the command: F5pt 2 XyWrite looks at the table labeled PT=2 in the current printer file. Each DeskJet 500 printer file contains a set of PT tables, but you may want to add another one for a font that hasn't been defined. For example, you may want to add a draft quality version of the 12-point/10 pitch Courier font. 1. Page down in the printer file until you see the PT table that most closely resembles the one you want to create. For example, if you want to create a draft version of 12-point Courier, locate the PT table that defines the letter-quality version of 12-point/10 pitch Courier. 2. Define the PT table you selected in step 1. 3. Move the cursor to the end of the PT section of the printer file, and copy the defined block. 4. Press F3 to restore the defined text. 5. In the new table, change the number after PT= to the next available number. For example, change PT=1 to PT=12. 6. Make the appropriate changes to the MD statements in the table. This step might involve changing point sizes, font names, or attribute names. Follow the exact naming conventions used in the DeskJet 500 printer files 7. Store and load the printer file. For more information on creating PT tables, refer to Application Note #162. Changing Print Quality The DeskJet 500 printer offers two print qualities, draft quality at 240 cps (characters per second), and letter quality (default setting) at 120 cps. The standard printer files are set up for letter quality. To access draft quality printing: 1. Call the printer file to the screen. Type: F5ca 3dj5-10u.prn 2. Search for the PT (Print Type) table that is set up to access the desired font. For example: Type: F5se /PT=1/ 3. Change each occurrence of LQ (Letter Quality) in PT=1 to DRAFT. For example: Type: F5cv /LQ/DRAFT/ (See Chapter 3 of the XyWrite III Plus Reference Guide for more information on the Change command.) 4. Store and load the printer file. To change back to letter quality, simply repeat the steps to change DRAFT back to LQ. To access both DRAFT and LQ with the same font, define and copy the existing PT table, give the new PT table a unique number, and change each occurrence of LQ to DRAFT. (Refer to ``Creating a New PT Table.'') This lets you access DRAFT and LQ for the same font by using separate PT commands rather than having to call and change the printer file each time you want to change print quality. Changing Underline Type The DeskJet 500 printer supports five types of under~lining, which are listed below with their attribute names: Regular (UNDERLINE) Double (D-UNDERLINE) Single floating (SF-UNDERLINE) Double floating (DF-UNDERLINE) Landscape (L-UNDERLINE) The position of single and double floating underlines is based on the font family (for example, Courier, Helvetica, Prestige, etc.), not on different point or pitch sizes within the same font family. While they work with any point size, they are best suited for large type sizes. Fixed underlines (regular and double) are always in the same location, no matter what font is being used. The landscape underline is required for landscape fonts. (See ``Landscape Printing.'') The standard DeskJet printer files use regular underline as the default value. You can define a different under~line type by modifying the appropriate MD (Mode) state~ment in the printer file's PT tables. For example, to change from regular underlining to double underlining for 12-point/10 pitch Courier: 1. Call the printer file to the screen. 2. Move the cursor to PT=1, which defines the mode statements for 12/10CO. 3. Change the attribute name in the MD UL line from UNDERLINE to D-UNDERLINE. The finished line should look like this: MD UL+12/10CO+D-UNDERLINE+LQ 4. Store and load the printer file. Result: When you TYPE your document, 12-point Courier text in under~line mode prints with a double underline. You can also define regular and double underline in the same PT table by using two MD statements. For exam~ple, use MD UL for regular underline and MD BR for double underline. In this case, the modified PT table would look like this: PT=1 MD NM+12/10CO+LQ MD BO+12/10CO-BOLD+LQ MD UL+12/10CO+UNDERLINE+LQ MD RV+12/10CO+FORMS MD BU+12/10CO-BOLD+UNDERLINE+LQ MD BR+12/10CO+D-UNDERLINE+LQ MD SU+12/10CO+SUPERSCRIPT+LQ MD SD+12/10CO+SUBSCRIPT+LQ When you TYPE your document, 12-point Courier text in underline mode has a single underline, while 12-point Courier text in bold reverse has a double underline. Using the Legal Symbol Set The DeskJet 500 printer has a symbol set of legal characters that can be accessed by: any font in the 10U symbol set; all cartridge fonts except M, P, and Q; and all 8A (HP 22708A), 8C (HP 22708C), and 8D (HP 22708D) soft fonts, except the ASCII character set portion (0U sumbol set, i.e., ASCII 32 through ASCII 127) of the soft font products. The printer file 3D5-10U.PRN includes a substitution table (SU:LEGAL) for the following characters: ASCII Value Produces: 007 Trademark symbol 015 Registered trademark symbol 017 Copyright symbol 027 Dagger symbol To access the legal characters: 1. Call the printer file to the screen. 2. Move the cursor to the font definition table you are using. Remove the semicolon from the line US:LEGAL and put a semicolon in front of the line US:PCSYMBOL. 3. Store and load the printer file. 4. Call your document to the screen. 5. Move the cursor to the place where you want one of the legal symbols to appear and enter its ASCII value (from the table above). For example, to print a copyright symbol: Type: Alt-Shift-17 Result: The Greek theta character appears on the screen, but the copyright symbol appears on the printed page. LANDSCAPE PRINTING In standard printing (also called portrait printing), char~ac~ters 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 DeskJet 500 print~er allows you to print your documents in either a por~trait or a landscape font, or to mix them on different pages within a document. (The DeskJet 500 does not allow you to mix portrait and landscape fonts on the same page, however.) Landscape Fonts Landscape printing is a built-in feature of the DeskJet 500. There are several different sizes of the internal Courier font that will print in landscape. For a list of these fonts, display the DeskJet 500 printer file and scroll to the table ``Standard Internal Fonts.'' Unless you plan to print underlined text, you can use the same PT tables for portrait and landscape orientation. If you do plan to underline, you need to create a new PT table and change the underline attribute. (See ``Modifying DeskJet 500 Printer Files.) PC Codes The default printing mode is portrait on letter-sized paper. To change to landscape, you need to send a control string to the DeskJet 500. The control string also specifies whether you are printing on letter-sized, legal-sized, or European-sized paper. To simplify the process of getting this information to the printer, XYQUEST put the required control strings in a PC table in the printer file (see Page 1). You send the appropriate PC code to the printer with the PB (Page Begin) command. You must enter PB commands before any text or PT (Print Type) commands. Note #2 Default Setting. Because portrait printing is the default setting, you don't need to send the code for portrait orientation unless you are returning to portrait from landscape. Formatting Commands When you change printing orientation, you change the ``shape'' of your text area. (For example, the form length is no longer 11 inches, but is 8-1/2 inches.) You therefore need to adjust the values in the embedded formatting commands in your document. (Remember, the DeskJet 500 ``steals'' a border area, so the maximum printing area for letter-sized paper is 10 inches by 7.5 inches.) For landscape printing on letter-sized paper, some typical values are: RM 100 FD 45 PL 42,44,40 Printing a Document in Landscape Orientation To activate landscape printing for an entire document: 1. Call the document to the screen. 2. Enter the appropriate PB command at the beginning of the file. For example: Type: F5pb 2 3. Enter the other formatting commands you want to apply to the document. For example: Type: F5pt 12 Type: F5rm 100 Type: F5fd 45 Type: F5pl 42,44,40 Result: When you print the document, the internal Courier font (in this case, specified by PT12) is printed in a landscape orientation on standard-sized paper. To print the document in landscape orientation on legal-sized paper, the procedure is as follows: 1. Load legal-sized paper in the printer according to the instructions in the DeskJet 500 documentation. 2. Call the document to the screen. 3. With the cursor at the beginning of the file, enter the appropriate PB command. Type: F5pb 4 4. Enter the rest of the formatting commands. For example: Type: F5pt 12 Type: F5rm 112 Type: F5fd 45 Type: F5pl 42,44,40 Result: When you print the document, the font specified by PT12 is printed in a landscape orientation on legal-sized paper. Mixing Portrait and Landscape Printing If you are switching from portrait to landscape in the same document, the most important thing to remember is that you must enter the PB command before the page it is to affect. For example, suppose you have a 3-page document and want pages 1 and 3 in portrait orientation, and page 2 in landscape: 1. Move the cursor to the end of page 1. 2. Enter the appropriate PB command for landscape printing. For example, for letter-sized paper: Type: F5pb 2 3. Enter a PG (Page Break) command and a carriage return. Type: F5pg Press: 4. Enter the PT command for your landscape font, along with the appropriate margin and page length settings. 5. Move the cursor to the end of page 2, enter the PB command that will set the printer back to portrait orientation. 6. Repeat step 3. 7. Enter the PT command for the portrait font, along with the appropriate margin and page length settings. PRINTING ON ENVELOPES The following sections describe the procedures for printing a single envelope and printing a series of envelopes using XyWrite's Mail Merge feature. Printing a Single Envelope Use the following procedure to print a single envelope. 1. Create a new file Type: F5new envelope 2. Enter the following embedded commands in the order shown. Type: F5pb 7 Type: F5fd 24 Type: F5pl 22,23,21 Type: F5lm 35 Type: F5rm 80 Type: F5tp 7 3. Type a carriage return to end the line of embedded commands. 4. Enter the name and address you want typed on the envelope. 5. Insert a #10 envelope head first, flap facing up, into the envelope guides on the OUT tray. With the right side of the envelope flush against the right side of the tray, push the envelope under the paper feed rollers until it stops. 6. Press the up and down arrow keys simultaneously on the printer. (Refer to the loading envelopes procedure in the Hewlett-Packard Professional Printer DeskJet 500 Owner's Manual for more information.) 7. Print the address. Type: F5type Using Mail Merge to Print Envelopes You can use XyWrite's Mail Merge capability to print a series of #10 envelopes as follows. 1. Create the data file and enter the names and addresses on your mailing list. Be sure to leave a blank line between each record. 2. Create the main file by following steps 1 and 2 under ``Printing a Single Envelope.'' 3. Type the appropriate FI and PF statements. (Refer to Chapter 5 of the XyWrite III Plus Reference Guide for information.) When in expanded mode, your completed main file should look something like this: ÿAEPB7ÿAFÿAEFD24ÿAFÿAEPL22,23,21ÿAFÿAELM35ÿAF ÿAERM80ÿAFÿAETP7ÿAF ÿAEFIname,address,city,state,zipÿAF ÿAEPFnameÿAF ÿAEPFaddressÿAF ÿAEPFcityÿAF, ÿAEPFstateÿAF ÿAEPFzipÿAF You can use this file as a standard envelope for~mat file (main file) with different mailing lists (data files). 4. Store the file and then send it to the printer (you must use the TY ,,p form of the Type command). Type: F5store Type: F5ty data+main,,p Note #3 Epson Emulation. There is an Epson emula~tion cartridge designed for the DeskJet 500 printerÄHP22707F. (You cannot use the HP22707E Epson Emulation cartridge originally designed for the DeskJet printer.) To use the HP22707F cartridge, you should load the printer file 3EPSONFX.PRN instead of 3DJ-PLS1.PRN. The file is located on the XyWrite Printer File disk that was part of your original package. Before loading it, however, call 3EPSONFX.PRN and add the following line immediately after the comments section: DF FD=60 This command changes the default form depth to 60 to accommodate the fact that the DeskJet 500 does not allow you to use the full 11 inches on the page.