8.155 bytes

Service Hints & Tips

Document ID: YAST-3G8JEH

PS/1 - Information on using printer control codes in Works

Applicable to: United States

Entering printer control codes into a Works document:
When you create documents in Works, you generally concentrate most of your attention on the numbers and letters you can see on your screen. However, these alphabetic, numeric, and punctuation characters rely on an invisible set of special characters to govern their appearance and placement within your document. Works uses some of these special characters to tell your printer how to handle the text of your Works documents.

Although Works takes care of most printer formatting tasks, you may need to send your printer a special control code not found on any of Works' menus. In this article, we'll show you how to include these codes in your Works documents. Then we'll show you how to use printer control codes to double-space a Works spreadsheet.

What are printer control codes?
When you issue a command from the Format menu or select a dialog box option to create a special formatting effect, Works inserts a printer control code into your document to tell your printer how to handle the special text. For example, when you choose the Bold command, Works may embed a control code such as [Esc]E (Epson LQ series) or [Esc](S3B (HP LaserJet IIP).

Because each printer uses different control codes to regulate formatting, Works must know which printer you've installed on your system so it can choose the correct set of codes.

That's why you had to tell Works what kind of printer you have.

When you create a document in Works, you won't see the printer control codes. Works inserts them only when you issue the Print command. However, you can view the control codes by printing a document to a file. When Works sends the document to your printer, Works inserts a printer control code at each point in the document where the formatting changes.

Inserting control codes:
You can use control codes to issue commands to your printer that you can't issue in Works. For instance, you can use printer control codes to tell your printer to double-space the data in a Works spreadsheet. You can also use control codes to choose options like double-height text or double-underlining. Since each printer offers a different suite of options, you'll need to check your printer manual to determine the potential uses for control codes.

Most printer control codes begin with the [Esc] character. Since Works reserves the [Esc] key for command functions, you can't insert an [Esc] character into a Works document simply by pressing that key.

Fortunately, the "Replace..." command makes it easy to insert the [Esc] character into a word processor document. With "Replace...", you can insert any character from the ASCII character set by typing its number in the Replace With Text box. Because the [Esc] character's ASCII code is 27, you can type a placeholder in the word processor document and then replace it with ASCII code 27.

Since the spreadsheet and database environments don't include the "Replace..." command, the only way to place [Esc] character into a spreadsheet is to copy it from a word processor document. You'll have to locate the appropriate codes in your printer's reference manual.

Double-spacing a Works spreadsheet:
In our example, we'll use the codes for an HP LaserJet IIP to print a double-spaced spreadsheet. Begin by locating the printer commands section of your printer's reference manual. To create a double-spaced spreadsheet, you'll need to find the proper vertical-motion printer commands. In most cases, your printer will have a six-lines-per-inch mode and a mode that allows you to specify the line height in fractions of an inch.

On the HP LaserJet, the code [Esc]&l3D establishes line spacing of three lines per inch. After you've located the proper line spacing code for your printer, open a new word processor document. Type @@ to hold a place for the [Esc] character and then type the remainder of the printer control code.

Next, press [Ctrl][Home] to move the cursor to the beginning of your document. Then, choose "Replace..." from the Select menu. In the Search For text box, type @@. In the Replace With text box, type ^27. Choose <Replace All> to insert the [Esc] character into your printer control code.

Press [Enter] to dismiss the subsequent dialog box and return to your document. Works replaces the placeholder @@ in your document with the [Esc] character, 1/4.

Now, open the spreadsheet you want to print double-spaced. For this example, we'll use the spreadsheet BUDGET.WKS that came with the Works program. First, select cell A1. Next, choose Insert Row/Column from the EDIT menu. Choose the Row option and press [Enter] or choose <OK> to dismiss the dialog box.

Return to your word processor document now by choosing WORD1.WPS from the Window menu. Now, highlight the printer control code and select COPY from the EDIT menu. Next, choose BUDGET.WKS from the Window menu. Finally, select cell A1 again and press [Enter] to place the printer control code into that cell.

Print the spreadsheet and the printer will recognize the control code and double-space the spreadsheet.

NOTE: Not all the printer codes use the [Esc] character. Some codes use other ASCII characters instead.

Search Keywords

Hint Category

Productivity Software, Printers

Date Created

17-04-97

Last Updated

23-03-99

Revision Date

23-03-2000

Brand

IBM Aptiva

Product Family

PS/1

Machine Type

2011, 2168, 2121, 2123, 2133, 2155

Model

C01; C34; M01; NEA; T35; U35; A62; A82; A94; B82; C42; C92; G42; M82; S92; 081; 087; 131; 137; K37; N31; N81; 11E; 13T; 14C; 16E; 17A; 18A; 18T; 19C; 21C; 23C; 28A; 46M; 51D; D50; G11; G13; G43; G46; G46; G49; G49; G50; G53; M40; M40; M46; M46; P11; P13; P43; P50; P53; R04; R05; R06; R09; R38; R42; R43; R44; R84; R86; R87; RO3; S11; S13; S43; S45; S45; S47; S47; S48; S48; S50; S53; W11; W13; W42; W42; W43; W45; W45; W50; W53; 20E; 22T; 24C; 24M; 28V; 39E; 41T; 43C; 45V; 48E; 50T; 52C; 55V; 72E; 74T; 76C; 78C; 79C; 81A; 82E; 84T; 86C; 87C; CC1; D53; G14; G44; G52; G54; G72; G76; G78; G82; NM1; P14; P44; P57; P71; P74; P76; P78; P84; R14; R15; R16; R17; R18; R51; R52; R57; R58; R62; R63; R67; R71; R89; R93; R96; R97; S14; S44; S50; S54; S70; S75; S76; S78; S80; W14; W44; W48; W54; W67; W76; W77; W78; Z33; 28V; 31E; 33T; 37C; 38C; 51E; 54T; 56C; 57C; 88V; BB1; G57; G87; OR1; OR3; OR4; OR5; P89; R28; R29; R31; R74; R78; R82; R98; S55; S85; SR1; US1; W52; W82

TypeModel

2011c01

Retain Tip (if applicable)

Reverse Doclinks
and Admin Purposes