Epson DFX-8500 Operation Manual

Add to My manuals

advertisement

Epson DFX-8500 Operation Manual | Manualzz

Recommended Operations

Recommended Command Order ...................................................................................................... R-4

Set the Printing Area............................................................................................................................ R-5

The printable area ............................................................................................................................ R-6

Setting left and right margins......................................................................................................... R-9

Setting page length......................................................................................................................... R-10

Setting top and bottom margins................................................................................................... R-13

Setting bottom margin................................................................................................................... R-13

Select Characters ................................................................................................................................ R-15

Assign character tables.................................................................................................................. R-15

Defining user-defined characters ................................................................................................ R-17

Planning user-defined characters............................................................................................ R-19

Setting user-defined character traits ....................................................................................... R-22

Copying ROM characters to RAM memory........................................................................... R-24

Storing user-defined character data in printer memory....................................................... R-25

Switching to RAM character printing ..................................................................................... R-36

Selecting an international character set ...................................................................................... R-41

Select a Font ........................................................................................................................................ R-42

Print quality (draft, LQ, or NLQ) ................................................................................................ R-43

Standard and scalable fonts (multipoint mode)........................................................................ R-43

Selecting the character table ..................................................................................................... R-44

Selecting the point size.............................................................................................................. R-45

Selecting the typeface ................................................................................................................ R-47

Selecting the pitch ...................................................................................................................... R-48

Selecting the style....................................................................................................................... R-50

Selecting the weight................................................................................................................... R-51

Enhancements ................................................................................................................................ R-51

Double-strike .............................................................................................................................. R-51

Shadow/outline ......................................................................................................................... R-52

Score ............................................................................................................................................. R-53

Super/subscript ............................................................................................................................. R-54

Select Supporting Features ............................................................................................................... R-55

Selecting unidirectional print head movement ......................................................................... R-55

Selecting print color....................................................................................................................... R-55

Select the Print Position .................................................................................................................... R-56

Moving the horizontal position ................................................................................................... R-57

Moving the vertical position ........................................................................................................ R-60

Send Print Data................................................................................................................................... R-64

R-1

R-2

Sending Graphics Data...................................................................................................................... R-65

Bit-image graphics ..................................................................................................................... R-66

Mixing text and bit-image graphics with ESC/P 2 printers ................................................ R-71

Graphics mode ........................................................................................................................... R-73

Standard raster graphics ........................................................................................................... R-74

Extended raster graphics (ESC . 2) .............................................................................................. R-83

Printing Bar Codes............................................................................................................................. R-84

Extended ESC/P 2 Programming Guide........................................................................................ R-99

MicroWeave technology............................................................................................................ R-99

Monochrome printing support .............................................................................................. R-100

Color bit-image graphics support.......................................................................................... R-100

ESC/P 2 color multipoint font support ................................................................................ R-100

ESC/P 2 MicroWeave color raster graphics and RLE compressed raster graphics........ R-101

ESC/P 2 MicroWeave color extended raster graphics—TIFF............................................ R-101

Programming examples .............................................................................................................. R-104

Example 1: ESC/P 2 color multipoint font driver............................................................... R-104

Example 2: MicroWeave ESC/P 2 standard color raster graphics and RLE compressed raster graphics driver............................................................................................................... R-105

Example 3: MicroWeave ESC/P 2 extended color raster graphics and TIFF compressed raster graphics driver............................................................................................................... R-107

This section describes the recommended method and order of performing operations on an EPSON dot matrix printer. An outline of recommended operation order is provided first, followed by detailed explanations of each operation.

Basic recommendations are provided for printers featuring ESC/P 2. You should follow these recommendations if you are writing programs for ESC/P 2 printers.

In addition, this section provides information on newly added ESC/P 2 commands, known as extended ESC/P 2, as well as programming examples for

EPSON’s high-resolution (up to 720 by 720 dpi) color printer models.

Where necessary, additional explanations are included for 24/48-pin printers at previous ESC/P levels, as well as for 9-pin printers. Although ESC/P 2 printers can operate using software written for earlier printers (if deleted and nonrecommended commands are avoided), you should use the ESC/P 2 level explanations to take full advantage of advanced ESC/P 2 features.

R-3

Recommended Command Order

Because some command results change based on the settings made with other commands, you should send commands and data in the order described in this section.

Once you set the printing area and page length, send data line by line from top to bottom of each page. The printer can handle data most efficiently when received in this order (although commands can move the vertical print position both up and down on a page). The exception to this rule is when printing bit-image graphics and characters on the same line, as described in “Mixing text and bitimage graphics.”

The following order is applicable to all ESC/P levels.

1. Send an ESC @ command to initialize the printer.

2. Set the unit of line spacing to the minimum vertical increment necessary.

3. Set the printing area.

4. Assign character tables to each of the four active tables as necessary (ESC/P 2 printers only).

5. Define any user-defined characters.

6. Select the font.

7. Set supporting features.

8. Set the print position.

9. Send one line’s print data.

10. End the line of data with a CR and LF command.

11. Repeat steps 6 to 10 as necessary for each following line on the page.

12. End the page with a FF command.

13. Repeat steps 6 to 12 as necessary for each following page (always send a FF command after the final page also).

14. End printing by sending the ESC @ command.

See the following sections in this chapter for additional information on the above steps.

R-4 Recommended Command Order

Set the Printing Area

The method of setting the printing area differs between ESC/P 2 and former

ESC/P levels. Both methods are described in the following sections.

ESC/P 2

With ESC/P 2, the following commands allow for improved page layout control:

• ESC ( U Set unit

This command sets the unit for horizontal and vertical movement and measurement. You can use this command to set the unit as small as 1/360 inch, allowing for precise page layout measurement.

• ESC ( C Set page length

The page length is based on the unit set with the ESC ( U command.

• ESC ( c Set page format

Based on the unit in ESC ( U, you can use this command to set the top and bottom margins. Because you can now set a top margin, the settings you make for the page actually match the physical page.

Because you can set the top and bottom margins for single-sheet paper, you can handle single-sheets the same as continuous paper.

Manually fed single sheets are now treated the same as paper fed from a cutsheet feeder (cut-sheet feeder mode has been eliminated).

ESC/P 2 ESC/P 9-Pin ESC/P

Set the print area as follows:

1. Set the left and right margins.

2. Set the page length.

3. Set the top and bottom margins ESC/P 2 printers

Set the bottom margin only Non-ESC/P 2 printers

(continuous paper only)

Set the Printing Area R-5

The printable area

ESC/P 2 ESC/P 9-Pin ESC/P

The printable area for continuous and single-sheet paper is shown below.

Single sheets (also envelopes and single-type multipart forms)

Continuous paper

*8.5 mm

Printable area

Printable area

**13.5 mm

3 mm 3mm

*, ** The nonprintable area varies on some printer models.

(See Feature Summary for details.)

9 mm

9 mm

3 mm 3mm

Printable area

Note:

• Make sure your program keeps printing within this area; otherwise, print quality cannot be assured.

• Make sure the margins stay within the printable area. The area within these margins is called the printing area.

R-6 Set the Printing Area

ESC/P 2

The following diagram shows the printing area for single-sheet and continuous paper.

Single sheets

Printing area = logical paper length

Continuous paper

Physical paper length = logical paper length

Actual page length

Printing area

Page length setting in printer

Actual page length

Printing area

Page length setting in printer

ESC/P 9-Pin ESC/P

Single sheets

Manual feed

Physical page length = logical page length

(same as continuous forms)

Continuous paper

Physical page length = local page length

Actual page length

Printing area

Page length setting in printer

Actual page length

Printing area

Page length setting in printer

Cut-sheet feeder

Logical page length = printable area

Actual page length

Printing area

Page length setting in printer

Set the Printing Area R-7

The printing area in ESC/P 2 differs for text and graphics printing.

If the point size is larger than 10.5 points, and the print position is near the top or bottom-margin position, part of the character may print outside the printing area

(above the top-margin or below the bottom-margin). The printer prints the full character, even though it falls outside the printing area, with the following exception:

If part of the character falls outside the printable area on single-sheet paper

(closer than 8.5 mm to the top edge or closer than 13.5 mm to the bottom edge), printing of that part is not assured.

When setting the vertical print position, you must place enough room at the top and bottom of a page for a full character to print.

The following diagram illustrates the differences between graphics and character printing areas near the top and bottom-margin positions.

Characters Graphics

20/180 inch

Nonprintable area

Top-margin position

Baseline

8 mm

(0.33 inch)

19/180 inch

Bottom-margin position

Baseline

Nonprintable area 13.5 mm

(0.53 inch)

Note:

• You can print characters outside the top and bottom-margin positions as long as the vertical print position is within the printing area. However, character printing within the nonprintable area is not assured; parts of characters may be cut off.

• You cannot print any part of graphics outside the top and bottom-margin positions.

R-8 Set the Printing Area

Setting left and right margins

ESC/P 2 ESC/P 9-Pin ESC/P

Use the ESC l command to set the left margin and the ESC Q command to set the right. The format of these commands is as follows:

ESC l m

ESC Q m

The m parameter equals the number of characters from the left-most mechanically printable position, in the current character pitch.

The following commands affect the character pitch (see individual commands in the Command Summary for details):

ESC P

ESC M

ESC g

ESC W 1

Selects 1/10-inch character width (10 cpi)

Selects 1/12-inch character width (12 cpi)

Selects 1/15-inch character width (15 cpi)

Doubles the current character width

ESC p 1

ESC SP n

Selects proportional spacing. When setting the margins, the character width is considered to be 1/10 inch

Adds extra space between each character (n/180 inch for LQ characters and n/120 inch for draft characters on 24/48-pin printers; n/120 inch on 9-pin printers).

The resulting character width is:

(current character width) = (previous character width) + (extra space)

SI Selects condensed printing, resulting in the following character widths:

1/17 inch if 10-cpi is currently selected

1/20 inch if 12-cpi is currently selected

ESC c

ESC X

Sets the character pitch to between 1/360 and 3 inches (available only on ESC/P 2 printers)

Sets pitch and point of scalable fonts (available only on ESC/P 2 printers).

Note:

• Once the margins are set, changing the character width does not affect the margins.

Set the Printing Area R-9

• The margins must be set at the beginning of the line (before any printable data is sent); otherwise, the printer ignores any data preceding these commands.

• Always set pitch before setting left and right margins. Do not assume what the pitch setting will be.

The diagram below shows the margins set by sending the following commands when 8 1/2-inch wide paper is used and the left edge of the paper is at the leftmost mechanically printable position.

ESC @ Resets printer settings

ESC P

ESC l 10

ESC Q 75

Selects 10-cpi printing (character width of 1/10 inch)

Sets a 1-inch left margin

Sets a 1-inch right margin

Margin diagram 8 1/2 inches

10 characters

75 characters

1 inch 1 inch

Setting page length

Because the method of page handling is different, the method for setting the page length differs for ESC/P 2 and previous ESC/P versions. This section explains both methods.

ESC/P 2

The ESC/P 2 method of setting the page length allows you to use the same program for both single-sheet and continuous paper.

The page length setting is effective only when you are using continuous paper.

However, since the printer ignores the setting during single-sheet printing, the printer is always ready to print on either type of paper.

R-10 Set the Printing Area

For single sheets, the printer calculates the page length as the distance between the top and bottom margins.

Single sheets Continuous paper

Page length setting in printer

Printing area

Actual page

Printing area

Page length setting in printer

Also, to simplify movement of the horizontal and vertical print position, ESC/P 2 provides the ESC ( U command for setting the unit of movement and measurement. The page length is set with the ESC ( C command, based on this unit.

Always set the unit before setting the page length. The unit can be set as small as

1/360 inch; set the unit to the minimum size necessary for vertical and horizontal movement within the current print job.

Note:

• Always set the page length before paper is loaded or when the print position is at the top-of-form position. Otherwise, the current print position becomes the top-of-form position, results in undesirable contradictions between the actual and logical page settings.

• Setting the page length cancels any previously set top or bottom margins.

• The maximum page length is 22 inches.

• Changing the unit after the page length has been set does not affect the page length.

The following commands set the page length to 11 inches, based on a unit of

1/360 inch.

ESC ( U 1 0 10

ESC ( C 2 0 120 15

Sets a unit of 1/360 inch

Selects a page length of 11 inches (3,960 units)

Set the Printing Area R-11

ESC/P 9-Pin ESC/P

For non-ESC/p 2 printers, set the page length with the following commands:

ESC C Sets the page length in lines, according to the currentline spacing

ESC C NUL Sets the page length in 1-inch increments

To set the page length in lines, you must first set the line spacing. The maximum number of lines you can set with the ESC C command is 127.

Use the following commands to set the line spacing:

ESC 2 Selects 1/6-inch line spacing

ESC 0

ESC + n

Selects 1/8-inch line spacing

Selects n/360-inch line spacing (24/48-pin printers only)

ESC 3 n Selects n/180-inch line spacing (24/48-pin printers)Selects n/216-inch line spacing (9-pin printers)

Note:

• Always set the page length before paper is loaded or when the print position is at the top-of-form position. Otherwise, the current print position becomes the top-of-form position, which results in undesirable contradictions between the actual and logical page settings.

• Setting the page length cancels any previously set bottom margin.

• The maximum page length is 22 inches.

• Changing the line spacing after the page length has been set does not affect the page length.

• Always set the line spacing before setting the page length with the ESC C command. Do not assume what the line spacing will be.

The following commands select 1/6-inch line spacing and a page length of 11 inches (66 lines).

ESC 2

ESC C 66

Selects 1/6-inch line spacing

Sets a page length of 11 inches (66 lines)

The following command also selects a page length of 11 inches.

ESC C NUL 11 Sets a page length of 11 inches

R-12 Set the Printing Area

Setting top and bottom margins

ESC/P 2

ESC/P 2 provides the ESC ( c command for setting both top and bottom margins.

This allows the printing area settings to match the actual paper.

The top and bottom margin settings are based on the unit defined with the ESC (

U command. If using continuous paper, you should have already defined this unit when you set the page length with the ESC ( c command. If not, see the description of the ESC ( U command in the Command Summary and “Setting the page length” in this section.

Note:

• Measure top and bottom margins from the top edge of the page.

• The distance from the top edge of the page to the bottom-margin position must be less than the page length; otherwise, the end of the page length becomes the bottom-margin position.

• Setting the top and bottom margins cancels previous top or bottom-margin settings.

• Changing the defined unit does not affect previously set top and bottommargin settings.

• Always set the top and bottom margins before paper is loaded or when the print position is at the top-of-form position. Otherwise, the current print position becomes the top-of-form position (this results in undesirable contradictions between the actual and logical page settings).

The following command sets a top and bottom margin of 1 inch when the unit is defined as 1/360 inch and 8 1/2 by 11-inch paper is used.

ESC ( c 4 0 104 1 16 14 Sets a top margin of 1 inch (360 units) and a bottom margin 10 inches (3,600 units) below the paper’s top edge.

Setting bottom margin

ESC/P 9-Pin ESC/P

When using continuous paper on non-ESC/P 2 printers, set the bottom margin with the ESC N command. The printer then automatically moves the print position to the top-of-form position of the next page when it receives a FF command, or when the print position moves below the bottom-margin position.

The ESC N command sets the bottom margin in lines above the top-of-form position of the following page; you must first set the line spacing.

Set the Printing Area R-13

Use one of the following commands to set the line spacing:

ESC 2 Selects 1/6-inch line spacing

ESC 0

ESC + n

Selects 1/8-inch line spacing

ESC 3 n

Selects n/360-inch line spacing (24/48-pin printers only)

Selects n/180-inch line spacing (24/48-pin printers)Selects n/216-inch line spacing (9-pin printers)

Note:

• Sending the ESC N command cancels any previous top or bottom margin setting.

• The bottom margin set with the ESC N command is ignored when printing on single sheets.

• Avoid using this command with ESC/P 2 printers. By using ESC/P 2’s ESC ( c command instead, the bottom margin is effective for both single-sheet and continuous paper.

• The distance from the top edge of the page to the bottom-margin position must be less than the page length.

• Use the ESC O command to cancel the bottom margin.

• Always set the line spacing before setting the bottom margin with the ESC N command. Do not assume what the line spacing setting will be.

The following commands set a bottom margin of 1 inch when 8 1/2 by 11-inch paper is used (assuming the top-of-form position is at the perforation between pages).

ESC 2

ESC N 6

Selects 1/6-inch line spacing

Sets a bottom margin 1 inch (6 lines) above the next page’s top-of-form position.

R-14 Set the Printing Area

Select Characters

ESC/P 2 ESC/P 9-Pin ESC/P

Character size and variation have been greatly increased in ESC/P 2. In addition to the basic 10.5-point characters and enhancements available in previous ESC/P versions, scalable font capability allows for the selection of fonts based on point size and five other font attributes. Point size can be selected from 8 to 32 points, in two-point increments.

Also, an increased number of built-in character tables allows access to characters and symbols not previously available.

The following sections explain how to select characters on all EPSON printers.

Differences between ESC/P 2 and previous ESC/P versions are explained when necessary.

To select characters, follow the command order outlined below:

1. Use the ESC ( t command to assign character tables you plan to use to one of the four active tables selectable with the ESC t command (ESC/P 2 printers only).

2. Define any user-defined (download) characters you plan to use.

3. Select the international character set you plan to use.

By making all the above settings, you have defined the initial characters. See the following sections for details on making each of these settings.

Assign character tables

ESC/P 2

On ESC/P 2 printers, a greater variety of characters is available because of an increased number of built-in character tables.

Previous versions of ESC/P allowed selection of an italics and graphics character table with the ESC t command. ESC/P 2 has expanded on this by allowing access to four active character tables with the ESC t command. Also, you can assign any of the numerous built-in (registered) character tables to these four active tables.

Select Characters R-15

The ESC/P 2 command for assigning these tables is ESC ( t. The diagram below illustrates this process.

Current

Table

ESC t n

Active Table

Table 0

Table 1

Table 2

Table 3

ESC ( t 3 0 n d

2

d

3

Registered d

2 d

3

0 0 Italic

1 0 PC437

.

.

.

.

8 0 PC863

9 0 PC865

.

.

.

.

112 0 OCR-B

Note:

• You always assign the tables at the beginning of a print job; do not assume what the settings are.

• You can reassign any of the tables at any time, without affecting other table assignments.

• Do not assign a registered table to Table 2 if you plan to use it for userdefined characters. Once you assign a registered table to Table 2, you must reset the printer (with the ESC @ command) before you can use it for userdefined characters.

The following commands assign character tables to active tables 0 to 3.

ESC ( t 3 0 0 0 0 Assigns the italic table to active Table 0.

ESC ( t 3 0 1 1 0

ESC ( t 3 0 2 8 0

Assigns the PC437 (US) table to active Table 1.

Assigns the PC865 (Canada-French) Table to active

Table 2.

ESC ( t 3 0 3 3 0 Assigns the PC850 (Multilingual) table to active

Table 3.

R-16 Select Characters

Defining user-defined characters

ESC/P 2 ESC/P 9-Pin ESC/P

With the user-defined character function you can design your own characters and save them in the printer’s memory for repeated use in a print job.

The printer has two types of character memory: ROM and RAM. The printer stores its built-in character sets in ROM memory; you cannot modify ROM memory. You can modify RAM memory, however, in two ways: you can copy characters from ROM memory and you can save user-defined characters.

The general method of defining characters (sometimes called downloading) is basically the same with all EPSON dot-matrix printers. However, the method of accessing user-defined characters depends on the ESC/P version. This section explains the basic process while describing the differences when necessary.

Note:

You can only print user-defined characters as 10.5-point characters (or 21-point characters when double-height printing is selected). Even if you select a different point size with the ESC X command, characters in RAM can only be printed as

10.5 or 21-point characters.

The steps below should be followed to create user-defined characters.

1 Plan the data for your desired characters. The amount of data required depends on the following factors:

− The number of dots in the print head (9 or 24/48)

− The space you specify on the left and right of each character

− Character spacing (10 cpi, 12 cpi, 15 cpi, or proportional)

− The size of your characters (normal or super/subscript)

− The print quality of your characters (draft, LQ, or NLQ mode)

2 Cancel italics with the ESC 5 command and set the following traits of the characters you plan to define:

− Print quality

− Size (either normal or super/subscript)—24/48-pin printers only

− Proportional or fixed character spacing—24/48-pin printers only

Select Characters R-17

3 The printer stores user-defined characters in RAM memory; you must tell the printer to find characters in RAM memory if you want to print user-defined characters. If you plan to use many of the standard characters along with your user-defined characters, use the ESC : command to copy the currently selected character table to the printer’s RAM memory. This allows you to print user-defined characters without having to switch from ROM to RAM characters and back again each time.

4 Define and send the data to the printer’s RAM memory using the ESC & command.

5 Switch to RAM characters. The printer then uses the user-defined characters when printing text.

Note:

• On 24/48-pin printers, you can use the ESC t 2 command to copy character data (including user-defined characters) from codes 0 to 127 to codes 128 to

255. This is desirable if you wish to print codes between 0 and 127 as usual while having access to user-defined characters.

• If you plan to use the ESC t 2 command to access user-defined characters on an ESC/P 2 printer, make sure you do not assign a registered character table to active Table 2 with the ESC ( t command. Once you have assigned a registered table to Table 2, you cannot use it for user-defined characters (until you reset the printer with the ESC @ command).

R-18 Select Characters

Planning user-defined characters

ESC/P 2 ESC/P 9-Pin ESC/P

User-defined characters are defined based on a combination of several traits. This combination of traits determines the number of dots that can be defined (and the amount of data that must be sent) for each character.

These traits, and the maximum recommended size for each combination of traits is shown in the table below. Exceeding the width for the following fixed pitches may not allow for sufficient spacing between characters.

24/48-pin printers (height × width)

Traits

Draft

LQ

Recommended size fixed-pitch fixed-pitch proportional super/subscript

24

×

12 (10 cpi)

24

×

10 (12 cpi)

24

×

8 (15 cpi)

24

×

36 (10 cpi)

24

×

30 (12 cpi)

24

×

24 (15 cpi)

24

×

37

16

×

36 (10 cpi)

16

×

30 (12 cpi)

16

×

24 (15 cpi) super/subscript, proportional 16

×

37

9-pin printers (height × width)

Traits Recommended size

Draft

NLQ

8

×

11

18

×

12

Note:

For 9-pin printers, NLQ user-defined characters are available only on LX-series printers.

Select Characters R-19

The diagrams below show the planning grids for LQ, NLQ, and draft mode characters.

24/48-pin

9-pin

15 cpi

12 cpi

10 cpi

Proportional

LQ

15 cpi

12 cpi

10 cpi

Proportional

Super/Subscript

15 cpi

12 cpi

10 cpi

Draft

10, 12 cpi

NLQ

12 cpi

10 cpi

Draft

R-20 Select Characters

Follow the steps below to plan a user-defined character.

1. First determine the type of characters you wish to define (for example, 24pin, LQ-mode, 12-cpi characters).

2. Consult the chart above for the maximum recommended dot-matrix size for your selected characters (the maximum for the example in step 1 is 24 dots high × 30 dots wide).

3. On the appropriate grid for your chosen character attributes, fill in the dots you wish to print to form your character. Keep the following restrictions in mind:

− You cannot print consecutive horizontal dots on 24-pin printers, or in draft-mode on 9-pin printers. The printer ignores the second of any consecutive horizontal dots. For example, the printer ignores the dots circled below.

− If you are defining proportional, LQ characters on 24-pin printers, you need to define the space to the left and the right when you send the characters to the printer.

− In the built-in character sets the character baseline is as follows:

24-pin printers Pin number 20

9-pin printers (draft)

(NLQ)

Pin number 7

Dot number 14 in the 18-dot column

Select Characters R-21

Setting user-defined character traits

Before you can define and save your user-defined characters, you must change the printer settings to match your planned characters. The following combinations of character traits are possible.

24 /48-pin printers

Print quality

Draft

LQ Normal size

Super/Subscript

Proportional Fixed pitch

3

3

3

3

3

9-Pin printers

Print quality

Draft

NLQ

3

3

Note:

You should not store characters in RAM memory when the printer is set to italic printing (with the ESC 4 command). Always send the ESC 5 command to cancel italic printing before you define user-defined characters or copy characters to

RAM memory.

Follow the steps below when setting the traits of your planned user-defined and other RAM characters. (Only steps 1 and 2 are necessary for 9-pin printers.)

1. Select the print quality: LQ, NLQ, or draft.

2. Cancel italic printing.

3. Select or cancel proportional spacing.

4. Select or cancel super/subscript characters.

R-22 Select Characters

The following commands are used to select the traits for your planned characters.

ESC x 1 Selects LQ-mode or NLQ-mode

ESC x 0

ESC S 0

Selects draft

Selects superscript

ESC S 1

ESC T

ESC 5

ESC p 1

Selects subscript

Cancels super/subscript

Cancels italic printing

Selects proportional spacing

ESC p 0 Cancels proportional spacing

Note:

• Always set or cancel all attributes; don’t assume what the current settings are.

• Once you have set the desired attributes, copy the ROM characters to RAM (if necessary) and define all user-defined characters before changing the attributes again. If you change the attributes and then define additional userdefined characters, the printer clears all characters previously in RAM memory.

Select Characters R-23

Copying ROM characters to RAM memory

ESC/P 2 ESC/P 9-Pin ESC/P

You must tell the printer where to find characters: either in the ROM memory (for built-in characters) or in the RAM memory (for user-defined characters). Each time you want to print a user-defined character, you must switch to RAM memory.

You may plan on using many of the standard characters along with your userdefined characters. If so, you can avoid having to switch between ROM and

RAM memory each time by copying the characters from the printer’s ROM memory to its RAM memory. The ESC : command performs this function.

When you send the ESC : command, the printer copies all the characters from locations 0 to 127 in the currently selected typeface to the same locations in RAM memory. You can then store your user-defined characters and still print all the other characters (except those you redefine) without having to switch back and forth between RAM and ROM memory each time.

Keep the following in mind when copying ROM characters to RAM memory.

• On some printers, you can specify which typeface to copy to RAM memory; see ESC : in the Command Summary and Command Table sections.

• You can only define 10.5-point characters. Even if you select a different point size with the ESC X command, characters in RAM can only be printed as

10.5-point characters (or as 21-point characters if double-height is selected).

• Sending the ESC : command erases any characters that are currently stored in

RAM. Always copy ROM characters to RAM before you define user-defined characters. (You cannot copy ROM characters to RAM during multipoint mode.)

• The RAM memory can only store characters of one type at the same time. If you define subscript user-defined characters when normal height characters are stored in RAM memory, for example, the printer erases all previously stored characters. Always set the desired character traits before copying characters (both ROM and user-defined characters).

• Characters copied from ROM to RAM with the ESC : command must have the same traits as the user-defined characters you plan to define. If you define user-defined characters with different traits, the printer erases all previous characters in RAM memory.

• Defining user-defined characters clears any characters previously at that character code location.

• To print characters in RAM, you must first copy characters with the ESC : command or define characters with the ESC & command. The printer ignores commands that would print characters that have not been defined; nothing will be printed.

R-24 Select Characters

Storing user-defined character data in printer memory

ESC/P 2 ESC/P 9-Pin ESC/P

Once you have set the neccessary traits for your characters (and copied the ROM characters to RAM memory, if desired), you can define and store your userdefined characters.

The following sections cover 9 and 24/48-pin printers. Since the command format is different for 9-pin printers, the explanation in “Sending user-defined characters to the printer” is divided into a 24/48-pin section and a 9-pin section.

Follow the steps below to define user-defined characters.

1. Prepare the data for each character you wish to define(including space to the left and right of each character).

2. Decide where to store your user-defined characters in RAM memory.

3. Use the ESC & command to define the characters in RAM memory.

Preparing data

1. First divide the grid of your planned character into columns. The height and number of columns depend on the traits of the characters you are defining.

24-pin normal height 24-pin super/subscript

Select Characters R-25

9-pin draft 9-pin NLQ

2. Divide each column into the following groups, depending on character and printer traits.

24-pin normal height

3 goups of 8 dots

24-pin super/subscript

2 groups of 8 dots

R-26 Select Characters

9-pin draft

1 goup of 8 dots

9-pin NLQ

2 groups of 8 dots, 1 group of 2 dots

3. Each group of dots is represented by a byte of data, and each dot within that group has a value as shown below. Add up the value of each dot in the group; the result is the value for the byte of data.

128

64

32 l Ù 32

16

8

4 l Ù 4

2

1 l Ù 1 Total 37

128

64

32

16 l

8

4

Ù 16

2

1 l Ù 1 Total 17

128 l Ù 128

64

32

16

8 l Ù 8

4 l Ù 4

2

1 Total 140

24-pin normal height

(byte values are the same for super/subscript)

128

64 l

32

16

8 l

4 l

2

1

Ù

Ù

Ù

64

8

4

Total 76

9-pin draft

128 l Ù 128

64

32

16 l Ù 16

8 l Ù 8

4

2

1 l Ù 1 Toal 153

128

64 l Ù 64

32

16

8

4 l

2

1

Ù 4

Total 68

128

64 l Ù 64 Total 64

9-pin NLQ

Select Characters R-27

4. Determine the value of the data bytes for all the columns in your design. The printer requires data in the order shown below.

1 4 7

2 5 8

3 6 9

24-pin normal height

1 3 5

2 4 6

24-pin super/subscript

1 4 7

1 2 3 2 5 8

3 6 9

9-pin draft 9-pin NLQ

Note:

The printer must receive complete columns of data. In other words, the number of bytes received must be a multiple of 3 for normal-height characters (on 24/48pin printers) and 9-pin NLQ characters, or a multiple of 2 for super/subscript characters. Draft 9-pin character columns are only 1-byte high.

R-28 Select Characters

Deciding where to store data

On 24/48-pin printers, you can copy characters directly into RAM memory in character locations 0 to 127. You can also use the ESC t 2 command to copy the characters you have defined to locations 128 to 255; then you can print all characters, including those at locations normally treated as control codes. See

“Switching to RAM character printing” for details.

Select Characters R-29

On most 9-pin printers, you can copy directly to 241 of the 256 RAM memory locations (you can copy only 6 characters on LX printers, from locations 58 to 63).

The following diagram illustrates the memory locations available.

The printer normally treats some of these codes as control codes. To print characters you store in these locations, see “Switching to RAM character printing” later in this section.

R-30 Select Characters

Sending user-defined characters to the printer

ESC/P 2 ESC/P

For 24/48-pin printers, use the ESC & command to send user-defined data to the printer. The format of the command is:

ESC & NUL n m [a

0

a

1

a

2

d

0

d

1

d

2

. . . d k

]

The value for n is the location of the first consecutive character you wish to redefine; m is the last character. See the ASCII character table in the Appendix for the order of the characters. To define just one character, n is the same as m.

Parameter a

0

specifies the number of blank columns to the left of the character and a

2

the blank columns to the right. The value for a

1

specifies the width of the character you are defining in dot columns.

Repeat the data within the brackets for each character you are defining. You must send a

0

, a

1

, and a

2

for each character you define. After sending a

0

, a

1

, and a

2

, send the actual dot data for each character, as described in “Preparing data.”

The following example replaces the + character with the following user-defined character:

First set the traits. For this character, define a normal height, fixed-pitch, LQmode character. The following commands set the traits (see “Setting user-defined character traits”):

ESC x 1 Selects LQ mode

ESC p 0

ESC T

Cancels proportional spacing

Cancels super/subscript

ESC 5 Cancels italic printing

Next, send the data for the character.

The character code of the character being replaced (+) is 43. Set n and m to 43.

Select Characters R-31

9-Pin ESC/P

Since you will not add any space to the left or right of the character, set the a

0

and a

2

parameters to 0. Since the character width is 34 columns, set a

1

equal to 34.

Then send the dot data.

The resulting command is as follows:

ESC & 0 43 43 0 34 0

The data (102 bytes) is as follows

0, 0, 0, 32, 0, 16, 0, 0, 0, 32, 0, 16, 0, 0, 0, 32, 0, 16, 0, 0, 0, 32, 0, 16, 31, 255, 224,

32, 0, 16, 31, 255, 244, 32, 0, 16, 0, 0, 0, 32, 0, 16, 0, 0, 0, 32, 0, 16, 0, 0, 0, 32, 0, 16,

0, 0, 0, 32, 0, 16, 0, 0, 0, 32, 0, 16, 0, 0, 0, 32, 0, 16, 31, 255, 224, 32, 0, 16, 31, 255,

224, 32, 0, 16, 0, 0, 0, 32, 0, 16, 0, 0, 0, 32, 0, 16, 0, 0, 0, 32, 0, 16

The character is now stored in location 43, the former + location. You can print the character by switching to RAM printing (see “Switching to RAM character printing”) and then sending code 43 (the + character).

Use the ESC & command to send user-defined data to the printer. The format of the command is:

Draft characters: ESC & NUL n m [a d

0

d

1

d

2

. . . d k

]

NLQ-mode characters:ESC & NUL n m [0 a 0 d

0

d

1

d

2

. . . d k

]

The value for n is the location of the first consecutive character you wish to redefine; m is the last character. See the ASCII character table in the Appendix for the order of the characters. To define just one character, n is the same as m.

Parameter a is called the attribute byte; the purpose of the attribute byteis different for draft and NLQ characters. Both explanations are included below.

The attribute byte for draft 9-pin characters

With draft 9-pin characters, the attribute byte sets the following parameters of the character you are defining:

• The pin group (the upper 8 pins or the lower 8 pins

− Select the upper 8 pins if your character has no descenders.

− Select the lower 8 pins if your character has descenders.

• The beginning column (during proportional spacing)

− The ending column (during proportional spacing)

R-32 Select Characters

This information is stored within the attribute byte as shown below.

bit value: vit number:

128 64 32 16 8 4 2 1

7 6 5 4 3 2 1 0 end column number start column number pins to use

To determine the value of the attribute byte, add up the numbers for the parameters you wish to set.

Attribute byte table

Beginning Column

Value Column number

0 0

1

2

3

16

32

48

6

7

4

5

64

80

96

112

Ending Column

Column number

1

2

3

4

5

6

7

8

9

10

11

Value

1

4

5

6

7

8

9

2

3

10

11

Upper/Lower 8 pins

Pin group

Upper 8 pins

Lower 8 pins

Value

128

0

Note:

• The beginning column and ending column settings are only used during proportional spacing. During proportional spacing, the columns to the left of the beginning column and to the right of the ending column are cut off.

• Proportional spacing is not available on LX-series printers.

For example, to define a character that begins in column 2 and ends in 9 (during proportional spacing) and is printed with the upper 8 pins, determine the attribute byte as follows:

Beginning column is 2

Ending column is 9

Upper 8 pins

Total attribute byte

Value

32

9

128

= 169

You must send an attribute byte for each character you define.

Select Characters R-33

The attribute byte for NLQ 9-pin characters

With NLQ characters, the attribute byte determines the width of the character only.

Determine the width of your pattern data in columns (1 to 12) and set the attribute byte equal to the number of columns. Repeat the data within the brackets for each character you are defining. You must send an attribute byte for each character you define.

Examples

The following example replaces the + character with the following 9-pin, draft, user-defined character:

Note:

Only the characters with codes between 58 and 63 may be user-defined on an LXseries printer.

First set the attributes. The following commands do this (see “Setting userdefined character traits”):

ESC x 0

ESC 5

Selects draft mode

Cancels italic printing

Next, send the data for the character. You must select the beginning and ending column if you want to use the character during proportional spacing; also, in this example you will be using the upper 8 pins.

To determine the value of the attribute byte, look at the chart above; your character starts in column 0 and ends in column 10.

Beginning column is 0

Ending column is 10

Upper 8 pins

Value

0

10

128

Total attribute byte = 138

Following the attribute byte is the pattern data.

R-34 Select Characters

The resulting command is as follows:

ESC & 0 43 43 169

The data (11 bytes) is as follows:

130, 0, 130, 124, 130, 0, 130, 124, 130, 0, 130

The command is now stored in location 43, the former + location. You can print the character by switching to RAM printing (see the following section) and then sending code 43 (the + character).

The following example replaces the = character with the following 9-pin NLQ user-defined character:

First set the attributes. The following commands do this (see “Setting userdefined character traits”):

ESC x 1

ESC 5

Selects NLQ mode

Cancels italic printing

Next, send the data for the character. Since this is an NLQ character, you must set the attribute byte to equal the character width. In this case, the width is 12 columns.

Send the pattern data following the attribute byte. The resulting command is as follows:

ESC & 0 61 61 0 12 0

The data (36 bytes) is as follows:

128, 8, 0, 128, 8, 0, 128, 8, 0, 255, 248, 0, 128, 8, 0, 128, 8, 0, 128, 8, 0, 128, 8,

0,255, 248, 0, 128, 8, 0, 128, 8, 0, 128, 8, 0

The command is now stored in location 61, the former = location. You can print the character by switching to RAM printing (see the following section) and then sending code 61 (the = character).

Select Characters R-35

Switching to RAM character printing

ESC/P 2 ESC/P 9-Pin ESC/P

Once you store user-defined characters in the printer (using the ESC & command), use the ESC % command to tell the printer to switch to RAM character printing. The format of the command is as follows:

ESC % 0

ESC % 1

Selects ROM characters

Selects user-defined characters (RAM memory)

After sending the ESC % 1 command, you can print the characters in the memory locations outlined below:

24/48-pin printer

R-36 Select Characters

9-pin printer

Select Characters R-37

ESC/P 2

The method of accessing characters in other areas varies depending on the type of printer.

There are two ways to access user-defined characters 0 to 31.

The first method is available only on ESC/P 2 printers. After changing to RAM characters with the ESC % 1 command, use the ESC ( ^ command to send character data. All data sent with the ESC ( ^ command is treated as character data. See ESC ( ^ in the Command Summary for details.

The table of accessible characters is as follows:

R-38 Select Characters

ESC/P 2 ESC/P

The second method is to select ESC % 0 (ROM character printing) and then send the ESC t 2 command. ESC t 2 copies all user-defined characters to the upper half of the character memory, and leaves the lower half as ROM characters. (In other words, the ESC t 2 command adds 128 to the user-defined character codes.)

Select Characters R-39

9-Pin ESC/P

The codes between 128 and 159, as well as between 0 and 31, are usually treated as control codes. Send the ESC I and ESC 6 commands to access characters 128 to

159 and the 18 non-control codes between 0 and 31.

The table of accessible characters then appears as below:

R-40 Select Characters

Selecting an international character set

ESC/P 2 ESC/P 9-Pin ESC/P

You can change up to 12 of the characters in the current character table with the

ESC R command. These 12 characters are called international character sets because they correspond to characters commonly used in several foreign languages.

The format for this command is as follows:

ESC R n

The parameter n determines which character set is selected.

The table below shows these characters and their codes in the Helvetica typeface, as well as the value of the parameter used in the ESC R command to select each character set.

n Set name Dec 35 36 64 91 92 93 94 96 123 124 125 126

Hex 23 24 40 5B 5C 5D 5E 60 7B 7C 7D 7E

0 USA

1 France

2 Germany

3 UK

#

#

#

£

$

$

$

$

@

à

§

@

°

[

Ä

[

\

ç

Ö

\

]

§

Ü

]

^

^

^

^

`

`

`

`

{

é

ä

{

ù

ö

|

|

}

è

ü

}

~

¨

ß

~

4 Denmark l

5 Sweden

6 Italy

7 Spain l

#

#

$ @ Æ Ø Å ^

`

` æ ø

¤ É Ä Ö Å Ü é

# $ @ °

Pt $ @ ¡

\

Ñ

é

¿

^

^

ù

ä

à

¨

ö

ò

ñ

å

å

è

}

~

ü

ì

~

8 Japan (Eng)

9 Norway

10 Denmark ll

11 Spain ll

12 Lat America

13 Korea

64 Legal

#

#

#

#

#

#

#

$ @ [ ¥ ] ^ ` { |

¤ É Æ Ø Å Ü é æ ø

$ É Æ Ø Å Ü é æ ø

$

$

á

á

¡

¡

Ñ

Ñ

¿

¿

é

é

`

ü

í

í

ñ

ñ

$ @ [ W

$ § ° ’ ”

] ^

¶ `

`

}

å

å

ó

ó

~

ü

{ | } ~

© ® † ™

ü

ú

ú

Select Characters R-41

Select a Font

ESC/P 2 ESC/P 9-Pin ESC/P

ESC/P 2 includes the ESC X command for selecting scalable fonts; differences in handling scalable fonts are discussed in each section.

The term font is often confused with typeface. Because the electronic printer field has evolved from basic beginnings, these two terms have often been used interchangeably.

However, fonts are defined by six attributes:

Attributes

Character table

Point size (height)

ESC/P 2

ESC t, ESC ( t

ESC X

Previous ESC/P levels

ESC t

ESC w

Typeface

Style (italics/normal)

Weight (bold/normal)

ESC k

Pitch (proportional/fixed spacing) ESC X, ESC c

ESC k

ESC P, M, g, p, W,

ESC SP, SO, SI, DC2, DC4

ESC 4, ESC 5 ESC 4, ESC 5

ESC E, ESC F ESC E, ESC F

Each time you change one of the above attributes, the printer selects a new font.

If a font matching the selected attributes is not available in the printer’s ROM memory, the printer manufactures a temporary font with those attributes.

You can set these attributes in any order; changing one attribute does not affect any other attribute. However, the printer selects fonts internally in the above order, so using that order is the most efficient.

You can modify each font with several enhancements, as follows:

Double-strike ESC G, ESC H

Score

Shadow/outline

ESC ( -, ESC -

ESC q

R-42 Select a Font

Print quality (draft, LQ, or NLQ)

ESC/P 2 ESC/P 9-Pin ESC/P

The following attributes are limited during draft printing:

• Typeface Draft typeface only

• Point size 10.5 and 21-point sizes only

Use the ESC x command to select the print quality, according to the following format:

ESC x 0

ESC x 1

Selects draft print quality

Selects LQ print quality for ESC/P 2 and ESC/P

Selects NLQ print quality for 9-Pin ESC/P

Standard and scalable fonts (multipoint mode)

ESC/P 2 ESC/P 9-Pin ESC/P

Both ESC/P 2 and previous ESC/P level printers can print the standard 10.5point fonts. You can modify the point size (height) and pitch of these characters with the following commands:

Size

SO, ESC W

ESC w

SI

Double-width printing

Double-height printing

Condensed printing

Spacing

ESC P

ESC M

ESC g

ESC p

ESC SP

Select 10 cpi

Select 12 cpi

Select 15 cpi (24/48-pin printers only)

Select proportional spacing

Add additional space between characters

By using ESC/P 2’s ESC X command to enter multipoint mode, you can select scalable fonts. Scalable fonts allow you to directly specify the point size and pitch of your characters.

Not all typefaces are available in multipoint mode; see the Command Table for the typefaces available in multipoint mode on each printer.

Select a Font R-43

During multipoint mode, sending the commands below results in the following:

Commands ignored

ESC W

ESC w

Double-width

ESC SP Additional space

SI

SO

DC2

DC4

ESC k

Double-height

Condensed printing

Double-width

Cancel condensed

Cancel double-width

(if typeface is not available in multipoint mode)

Commands that cancel multipoint mode

ESC P Select 10 cpi

ESC M Select 12 cpi

ESC g

ESC p

ESC !

Select 15 cpi

Select proportional

Master select

ESC @ Reset

Selecting the character table

Use the ESC t command to select the character table. The format for this command is as follows:

ESC t n

The parameter n is the number of the character table.

ESC/P 2

With ESC/P 2, you can select from four active character tables. See “Assign character tables” for details.

Active Tables

Table 0

Current

Table

ESC t n Table 1

Table 2

Table 3

ESC/P 9-Pin ESC/P

With previous ESC/P versions, you can select from two character tables: italics and graphics.

Italics

Current

Table

Graphics

The character table is one attribute of the font. Selecting a different character table selects a different font.

R-44 Select a Font

Selecting the point size

The height of characters is measured in points. One point is equal to 1/72 inch.

Vertical print position

20/72 inch 10.5/72 inch

20-point character 10.5-point character

ESC/P 2

If you plan to use typefaces available in multipoint mode, you can set the point size with the ESC X command. This command puts the printer in multipoint mode and sets the point and pitch of the font.

The format of the ESC X command is as follows:

ESC X m n

L

n

H

The m parameter sets the pitch and the n

L

and n

H

parameters set the point size, according to the following formulas:

Pitch m = 0 the pitch does not change; use this value if you plan to change only the point size.

m ≥

1 proportional spacing is selected.

5

360 m cpi character spacing

Point size

(point size) =

( n

H

× 256 ) +

2 n

L

If n

H

and n

L

both equal 0, the point size does not change; use these values if you plan to change only the pitch.

Select a Font R-45

32 points

26 points

20 points

14 points

8 points

30 points

24 points

18 points

12 points

Note:

• Some commands are ignored during multipoint mode and some commands cancel multipoint mode. See the list in “Standard and scalable fonts

(multipoint mode).”

• You can select characters equivalent to previous ESC/P levels by adjusting the point and pitch with the ESC X command. See the Appendix for details.

• The baseline of all characters is 20/180 inch below the current vertical print position. See “Selecting the print position.”

R-46 Select a Font

ESC/P 2 ESC/P 9-Pin ESC/P

Non-ESC/P 2 and typefaces not available in multipoint mode

Characters normally have a size of 10.5 points. You can also print 21-point characters as shown below.

ESC w 1

ESC w 0

Selects double-height (21-point) characters

Selects normal (10.5-point) characters

Selecting the typeface

ESC/P 2 ESC/P 9-Pin ESC/P

Select the typeface using the ESC k command. The parameters for selecting each available typeface setting are shown below:

Command

ESC k 0

ESC k 1

*ESC k 2

*ESC k 3

*ESC k 4

*ESC k 5

*ESC k 6

*ESC k 7

*ESC k 8

*ESC k 9

Typeface name Character samples (24-pin)

Roman

Sans serif

Courier

Prestige

Script

OCR-B

OCR-A

Orator

Orator-S

Script C

*Only available on 24/48-pin printers

Note:

Not all typefaces are available in multipoint mode; see the Feature Summary for the typefaces available in multipoint mode.

Select a Font R-47

Selecting the pitch

ESC/P 2

ESC/P 2 provides two ways of setting the pitch: the ESC X command and the

ESC c command.

If you plan to use multipoint mode typefaces, you can set the pitch with the ESC

X command. This command puts the printer in multipoint mode and sets the pitch and point size of the font.

The format of the ESC X command is as follows:

ESC X m n

L

n

H

The m parameter sets the pitch and the n

L

and n

H

parameters set the point size, according to the following formulas:

Pitch m = 0 The pitch does not change

1 Proportional spacing is selected m ≥ 5

360 m cpi character spacing

Point size

(point size) =

( n

H

× 256 ) +

2 n

L

If n

H

and n

L

both equal 0, the point size does not change; use this value if you plan to change only the pitch.

See the section on proportional character width during multipoint mode in the

Appendix.

Note:

• Some commands are ignored during multipoint mode and some commands cancel multipoint mode. See the list in “Standard and scalable fonts

(multipoint mode).”

• You can select characters equivalent to previous ESC/P levels by adjusting the point and pitch with the ESC X command. See the Appendix for details.

R-48 Select a Font

ESC/P 2

You can also set the pitch with the ESC c command. This command sets the horizontal motion index (HMI) in inches per character rather than in cpi. The format of this command is as follows:

ESC c n

L

n

H

HMI =

( n

H

× 256 ) +

360 n

L

inch n

H

= INT

HMI × 360

256 n

L

= MOD

HMI × 360

256

The HMI set with the ESC c command cancels the pitch set with the ESC X command.

The following commands cancel the HMI set with the ESC c command:

ESC W

ESC M

ESC SP

SI

SO

DC2

DC4

Double-width

Select 12 cpi

Additional space

Condensed printing

Double-width

Cancel condensed

Cancel double-width

ESC P

ESC w

ESC g

ESC p

ESC !

ESC @

ESC X

Select 10 cpi

Double-height

Select 15 cpi

Select proportional

Master select

Reset

Select pitch and point

ESC/P 9-Pin ESC/P

Non-ESC/P 2 printers and typefaces not available in multipoint mode

For previous ESC/P-level printers, as well as ESC/P 2 printers that are not in multipoint mode, you can adjust the character pitch by setting the following features:

Proportional spacing

12-cpi character spacing

Condensed printing

Double-width printing

10-cpi character spacing

15-cpi character spacing

Intercharacter spacing

The following commands produce the fixed pitches indicated:

Pitch

5 cpi

6 cpi

7.5 cpi*

10 cpi

12 cpi

15 cpi*

17 cpi

20 cpi

Individual commands Master Select

ESC W 1, ESC P ESC ! 32

ESC W 1, ESC M

ESC W 1, ESC g

ESC P

ESC M

ESC g

ESC P, SI

ESC M, SI

ESC ! 33

ESC ! 32, ESC g

ESC ! 0

ESC ! 1

N/A

ESC ! 4

ESC ! 5

*These pitches are not available on 9-pin printers.

Select a Font R-49

Note:

• When you select the 7.5-cpi and 15-cpi pitches the character height is reduced on most printers.

• See ESC ! (the Master Select command) in the Command Summary.

Use the ESC p command to select proportional spacing. In this type of spacing, the character width varies by character; thin characters like t receive less space than wide characters like M. The format for this command is as follows:

Individual command Master select

ESC p 1

ESC p 0

ESC ! 2

N/A

Selects proportional spacing

Cancels proportional spacing

See the proportional width table in the Appendix for the exact width of proportional width characters.

A final way you can adjust the pitch is with the ESC SP command. Use this command to add a fixed amount of space to the right of every character. The format of this command is as follows:

ESC SP n

The additional space is either n/120 inch or n/180 inch, depending on the current printer settings; see ESC SP in the Command Summary for details. This additional space is added to both fixed-pitch and proportional characters.

Selecting the style

ESC/P 2 ESC/P 9-Pin ESC/P

The term style refers to whether a character is upright or italic. Select the style attribute with the ESC 4 or ESC 5 commands.

ESC 4

ESC 5

Select italic printing

Cancel italic printing (Select upright printing)

Upright

Italic

Note:

You cannot italicize graphics characters.

R-50 Select a Font

Selecting the weight

ESC/P 2 ESC/P 9-Pin ESC/P

The term weight refers to the thickness (or boldness) of printed lines in a character. Set the weight attribute with the ESC E and ESC F commands.

ESC E

ESC F

Sets the weight attribute to bold

Sets the weight attribute to normal (cancels bold)

Normal

Bold

Enhancements

ESC/P 2 ESC/P 9-Pin ESC/P

To modify fonts, several enhancements are available: double-strike, shadow, outline, and scoring.

On 9-pin printers, the only enhancement available is double-strike (only during draft printing) and single, continuous, and underline scoring.

These are not attributes of a font and do not affect font definition. These enhancements can be applied to both multipoint and normal fonts.

Double-strike

ESC/P 2 ESC/P 9-Pin ESC/P

The double-strike feature produces bolder printing by striking each dot twice.

The commands for this feature are as follows:

ESC G

ESC H

Selects double-strike printing

Cancels double-strike printing

Note:

On 9-pin printers, NLQ-mode overrides double-strike; double-strike resumes when the printer returns to draft printing.

Normal

Double-strike

Select a Font R-51

Shadow/outline

ESC/P 2 ESC/P

The shadow and outline enhancements are available only on 24/48-pin printers.

Normal

Outline

Shadow

Outline and shadow

The command for shadow/outline printing is ESC q; the format is as follows:

ESC q 0

ESC q 1

ESC q 2

ESC q 3

Turn off outline/shadow printing

Turn on outline printing

Turn on shadow printing

Turn on both outline and shadow printing

Note:

This command does not affect graphics characters.

R-52 Select a Font

Score

ESC/P 2 ESC/P 9-Pin ESC/P

Several types of scoring are available on 24/48-pin printers, as shown below:

Note:

You can use the ESC- command to select single, continuous underlining on 9-pin printers. This is the only type of scoring available on 9-pin printers.

The command for selecting scoring is ESC ( -, and its format and combinations are as follows:

ESC ( - 3 0 1 n

1

n

2 n

1

= 1 Underline

2 Strikethrough

3 Overscore n

2

= 0 Turn off scoring

1 Single continuous line

2 Double continuous line

5 Single broken line

6 Double broken line

Note:

• Each type of scoring is independent of other types; any combination of scoring can be set simultaneously.

• The score is printed in the currently selected print quality and is affected by the bold and double-strike commands.

• You cannot score graphics characters.

Select a Font R-53

Super/subscript

ESC/P 2 ESC/P 9-Pin ESC/P

The super/subscript command prints characters at approximately two-thirds the currently selected point size.

Superscript characters are printed in the upper two-thirds of the normal character space; subscript characters are printed in the lower two-thirds.

Super/subscript is available in both normal and multipoint modes.

Following are examples of super/subscript characters.

The commands for super/subscript printing and their format is as follows:

ESC S 1

ESC S 0

ESC T

Selects subscript printing

Selects superscript printing

Cancels super/subscript printing

Note:

• You cannot print graphics characters as super/subscript characters.

• See “Proportional character widths” in the Appendix for information on the proportional width of super/subscript characters.

• During underline printing, the underline strikes through the descenders on subscript characters.

• During multipoint mode, the available point size nearest to two-thirds the size of the current font is selected for super/subscript characters.

• If the current point size is 8 points, super/subscript character size is not reduced.

R-54 Select a Font

Select Supporting Features

Other features that affect the appearance of characters and graphics are unidirectional and color printing.

Selecting unidirectional print head movement

ESC/P 2 ESC/P 9-Pin ESC/P

Normally, printing is bidirectional. Although the print head positions dots very accurately, print head movement has a slight effect on dot position. This effect is sometimes noticeable when printing graphics that include continuous vertical lines or large point-size characters.

To achieve maximum alignment accuracy, use the unidirectional feature. During unidirectional printing, the print head prints only from left to right.

Select unidirectional printing as follows:

ESC U 0

ESC U 1

Selects bidirectional printing (cancels unidirectional)

Selects unidirectional printing

Selecting print color

ESC/P 2 ESC/P 9-Pin ESC/P

Use the ESC r command to select the print color on printers capable of color printing.

The format of the ESC r command is as follows:

ESC r 0

ESC r 1

ESC r 2

ESC r 3

ESC r 4

ESC r 5

ESC r 6

Black

Magenta

Cyan

Violet

Yellow

Red

Green

Select Supporting Features R-55

Note:

• Printers not capable of color printing ignore this command.

• Other colors are possible by overprinting the above colors. When combining yellow with other colors, always print yellow dots first (this prevents soiling of the print side of the ribbon).

• ESC/P 2 printers can print only black, magenta, cyan, and yellow during graphics mode.

• When printing in extended graphics mode selected with the ESC . 2 command, use the binary mode command <COLR> to select the color.

Extended graphics mode is only available on the Stylus COLOR and later high-resolution printer models. For more information, see “Extended

ESC/P 2 Programming Guide” later in this section.

Select the Print Position

ESC/P 2 ESC/P 9-Pin ESC/P

The definition of the vertical print position differs for text and graphics printing.

Physically, the print position corresponds to the top pin in the print head when graphics or 10.5-point characters are printed. However, to assure that the baseline of all characters is the same, the baseline is defined as 20/180 inch (7/72 inch for

9-pin printers) below the vertical print position no matter what point-size characters you are printing.

Text printing The baseline of the character is printed 20/180 inch

(7/72 inch for 9-pin printers) below the vertical print position; the left-most column of the characters is printed at the horizontal position.

Graphics printing The print position is the top printable row of dots.

The following diagram illustrates the relationship between the print head and the text/graphics print position.

Vertical print position

Ag

Ag

Baseline

10.5-point characters 16-point characters Graphics

R-56 Select Supporting Features

ESC/P 2

ESC/P 2 has new commands that allow for easier vertical and horizontal movement of the print position.

These new commands are:

ESC ( U

ESC ( V

ESC ( v

Sets a unit that is used for moving the print position and setting the page format

Sets the absolute vertical position on the page

Sets the relative vertical position on the page

Horizontal movement is performed with commands available in previous ESC/P versions. However, now the increment of movement is the unit set with the ESC (

U command.

ESC $

ESC \

Sets the absolute horizontal position

Sets the relative horizontal position

The following sections describe moving the print position, with explanations for both ESC/P 2 and previous ESC/P versions.

Moving the horizontal position

ESC/P 2 ESC/P 9-Pin ESC/P

The horizontal print position is defined as the position where the left-most printable column of dots is printed for the next character or graphics design.

When you print characters or spaces, the printer automatically moves the print position according to the pitch you select (or the width of each character if you select proportional spacing).

To move the the horizontal print position independent of character printing, the recommended commands are as follows:

ESC $

ESC \

HT

Set the absolute horizontal position

Set the relative horizontal position

Horizontal tab

The format of the ESC $ command is as follows:

ESC $ n

L

n

H

The resulting horizontal position is determined by the formula below.

(horizontal position) = ((n

H

× 256) + n

L

) × (defined unit) + (left margin) n

H

= INT













(

( horizontal position − arg in position )

)

256

×

1

( defined unit )













Select the Print Position R-57

n

L

= MOD













(

( horizontal position − arg in position )

)

256

×

1

( defined unit )













The defined unit varies as follows:

ESC/P 2 printers The unit defined with the ESC ( U command

Non-ESC/P 2 printers 1/60 inch

The format of the ESC \ command is as follows:

ESC \ n

L

n

H

The horizontal position is determined by the formula below.

(horizontal position) = ((n

H

× 256) + n

L

) × (defined unit) + (current position)

To move to the right of the current print position n

H

= INT













(

( horizontal position current position )

)

256

×

1

( defined unit )











 n

L

= MOD













(

( horizontal position current position )

)

256

×

1

( defined unit )













To move to the left of the current print position n

H

= 32768 − INT













(

( current position ) ( horizontal position )

)

256

×

1

( defined unit )











 n

L

= 32768 − MOD













(

( current position ) ( horizontal position )

)

256

×

1

( defined unit )













The defined unit varies as follows:

ESC/P 2 printers The unit defined with the ESC ( U command

Non-ESC/P2,

24/48-pin printers

LQ mode 1/180 inch

Draft mode 1/120 inch

9-pin printers 1/120 inch

R-58 Select the Print Position

Note:

• These commands have no effect on the vertical print position.

• The printer ignores commands that would move the print position outside the left or right margins.

• Character scoring (underline, overscore, and strikethrough) is not performed between the current and final print positions when the ESC $ command is used. Scoring is also not performed if the ESC \ command moves the print position in the negative direction.

You can also use the tab command to move the horizontal print position to the next tab position.

First set the tabs with the ESC D command. The format of the ESC D command is as follows:

ESC D n

1

n

2

. . . n k

NUL

Sets horizontal tab positions (in the current character pitch) at the columns specified by n

1

to n k

, as measured from the left-margin position

Note:

• The values for n must be in ascending order; a value of n less than the previous n ends tab setting (just like the NUL code).

• Changing the character pitch does not affect current tab settings.

• Send an ESC D NUL command to cancel all tab settings.

• The tab settings move to match any movement in the left margin.

• A maximum of 32 horizontal tabs can be set.

• The printer does not move the print position to any tabs beyond the rightmargin position. However, all tab settings are stored in the printer’s memory; if you move the right margin, you can access previously ignored tabs.

• The printer calculates tab positions based on 10 cpi if proportional spacing is selected with the ESC p command.

• Sending the ESC D command clears any previous tab settings.

Sending the HT command moves the print position to the next tab position to the right of the current position.

Note:

• The HT command has no effect on the vertical print position.

• The printer ignores an HT command that would move the print position outside (to the right of) the right-margin position.

• Character scoring (underline, overscore, and strikethrough) is not performed between the current and final print positions when the HT command is sent.

Select the Print Position R-59

Moving the vertical position

ESC/P 2

20/180 inch

For ESC/P 2 printers, the vertical print position is defined as follows:

• The position 20/180 inch above the baseline during character printing

• The position of the top printable row of dots during graphics printing

Note:

When setting the vertical print position, you must place enough room at the top and bottom of a page for a full character to print.

If the point size is larger than 10.5 points, and the print position is near the top or bottom-margin position, part of the character may print outside the printing area

(above the top-margin or below the bottom-margin position). The printer prints the full character, even though it falls outside the printing area, with the following exception:

If part of the character falls outside the printable area on single-sheet paper

(closer than 8.5 mm to the top edge or closer than 13.5 mm to the bottom edge), that part is not assured.

Characters Graphics

Nonprintable area

Top-margin position

Baseline

8 mm

(0.33 inch)

19/180 inch

Bottom-margin position

Baseline

Nonprintable area 13.5 mm

(0.53 inch)

Note:

• Always set the vertical print position so sufficient room is provided for the full character to print.

• Graphics data falling outside the printing area is ignored.

R-60 Select the Print Position

New commands are available in ESC/P 2 that simplify setting the vertical print position. These commands are:

ESC ( V

ESC ( v

Set absolute vertical print position

Set relative vertical print position

The unit of movement for both these commands is the unit set with the ESC ( U command. See ESC ( U in the Command Summary and “Setting the page length” for more information.

The format for the ESC ( V command is as follows:

ESC ( V 2 0 m

L

m

H

The resulting vertical position is determined by the following formula:

(vertical position) = ((m

H

× 256) + m

L

) × (defined unit) + (top-margin position) m

H

= INT













(

( vertical position − arg in position )

)

256

×

1

( defined unit )











 m

L

= MOD













(

( vertical position − arg in position )

)

256

×

1

( defined unit )













The format for the ESC ( v command is as follows:

ESC ( v 2 0 m

L

m

H

(horizontal position) = ((m

H

× 256) + m

L

) × (defined unit) + (current position)

To move in the positive direction (down the page), the formula is as follows: m

H

= INT













(

( vertical position current position )

)

256

×

1

( defined unit )











 m

L

= MOD













(

( vertical position current position )

)

256

×

1

( defined unit )













To move in the negative direction (up the page), the formula is as follows: m

H

=

3 2 7 6 8 − I N T













(

( c u r r e n t p o s i t i o n vertical p o s i t i o n )

)

×

2 5 6

1

( d e f i n e d unit )











 m

L

= 32768 − MOD













(

( current position ) ( vertical position )

)

256

×

1

( defined unit )













Select the Print Position R-61

ESC/P 2

Note:

• These commands have no effect on the horizontal print position.

• The printer ignores the ESC ( v command if it would move the print position above the top margin.

• If a command would move the print position below the bottom margin position, the print position moves to the top-margin position on the following page.

• You cannot move the print position more than 179/360 inch in the negative direction from the current print position.

• The printer ignores this command under the following conditions:

− The command would move the print position more than 179/360inch in the negative direction

− The command would move the print position in the negative direction after a graphics command is sent on the current line

− The command would move the print position in the negative direction beyond the position of any previous graphics printing

9-Pin ESC/P

For Non-ESC/P 2 printers, the vertical position is defined as follows:

• The position 20/180 inch (7/72 inch for 9-pin printers) above the baseline during character printing

• The position of the top printable row of dots during graphics printing

The following commands are recommended for moving the vertical print position within a page.

ESC J

LF

Advance the print position vertically

Line feed

The format for the ESC J command is as follows:

ESC J n

This command moves the paper forward according to the following formula.

24/48-pin printers

9-pin printers

(distance down) = n/180 inches

(distance down) = n/216 inches

This command has no effect on the horizontal print position.

The LF command affects both the vertical and horizontal positions. Sending the

LF command performs the following functions:

• Moves the print position one line forward in the currently selected line spacing

• Moves the horizontal print position to the left-margin position

R-62 Select the Print Position

Note:

Paper handling at the end of a page differs depending on paper type, loading method, and ESC/P version.

ESC/P 2

ESC/P

Continuous paper

Single-sheet paper

If an ESC J, LF, ESC ( V, or ESC ( v command would move the print position below the bottom margin position, the printer moves the print position to the top-margin position on the following page.

If an ESC J, LF, ESC ( V, or ESC ( v commandwould move the print position below the bottom-margin position, the printer ejects the sheet of paper.

9-Pin ESC/P

Continuous paper If an ESC J or LF command would move the print position below the bottom-margin position, the printer moves the print position to the top-of-form position on the following page.

Single-sheet paper

Loaded by cut-sheet feeder If an ESC J or LF command would move the print position below the end of the printable area, the printer ejects the paper.

Loaded by hand If an ESC J or LF command would move the print position below the end of the printable area, the printer feeds the paper until the end of the page. After the next sheet is loaded, the printer feeds the paper the remaining distance specified in the ESC J or LF command.

Select the Print Position R-63

Send Print Data

ESC/P 2 ESC/P 9-Pin ESC/P

Once you have set the page format, defined the starting characters, and set the initial print position, you can begin sending print data.

The following rules allow the printer to process data most efficiently.

• Send data from left to right on a line.

• End each line of data with a CR and LF command.

• Send lines from the top to the bottom of the page.

• Complete each page with a FF command. Also send a FF command at the end of each print job.

Note:

The exception to this data order is when you combine bit-image graphics with text printing. See “Mixing text and bit-image graphics” for details.

To vary printed characters, you can change font attributes and enhancements at any time. See the following sections for information on preparing and sending graphics data.

R-64 Send Print Data

Sending Graphics Data

ESC/P 2 ESC/P 9-Pin ESC/P

Two kinds of graphics printing are possible: bit-image and raster graphics.

Although both types of graphics are based on bits in the data bytes, the relationship between the data order and dot printing differs.

Bit Image

• Bit-image graphics was developed with the layout of the print head in mind.

Data is organized to correspond to columns of print head output. Printing takes place after each complete line is sent.

• Bit-image graphics can be mixed with text printing.

• Bit-image graphics is available on all printers.

Raster Graphics

• Raster graphics treats data in essentially the same way as video displays and laser printers. Data is sent in one-dot high lines. The printer reorganizes the data internally to correspond to the print head layout. Printing may not take place at the end of the line.

• There are two levels of raster graphics: standard and extended. Standard raster graphics is available only on ESC/P 2 printers. Extended raster graphics is available only on the Stylus COLOR and later high-resolution

ESC/P 2 printer models.

• Standard raster graphics has a special data compression feature that allows you to economize on the data necessary to print graphics. Extended raster graphics provides two additional data compression schemes.

• Text and raster graphics printing cannot be combined on the same page.

The illustrations below show the difference between raster and bit-image data processing.

Raster graphics

Bit-image graphics

Sending Graphics Data R-65

Note:

For detailed information on programming for EPSON’s Stylus COLOR and other high-resolution color printers, see “Extended ESC/P 2 Programming Guide” at the end of this chapter.

To eliminate potential command conflicts during raster graphics printing,

EPSON provides a special graphics mode. In this mode, some commands are not available. See “Graphics mode” for details.

Bit-image graphics

ESC/P 2 ESC/P 9-Pin ESC/P

Bit-image graphics is available on all printers. Data handling varies, however, depending on the number of pins in the print head.

The steps for printing bit-image graphics are as follows:

1. Determine vertical and horizontal dot density.

2. Prepare and organize bit-image data.

3. If you plan to send more than one line of graphics, set the line spacing to match the height of the print head.

4. Set the vertical and horizontal print position to the top left corner of the graphics line.

5. Send one line of bit-image data to the computer.

6. Complete the line with a CR and LF command.

7. Repeat steps 5 and 6 until the full graphics design is printed.

Determining vertical and horizontal dot density

ESC/P 2 ESC/P 9-Pin ESC/P

The ESC * command is used to print bit-image graphics.

The format of this command is as follows:

ESC * m n

L

n

H

d

1

d

2

. . . d k m Specifies the dot density and printing speed. The dot density can be specified from 60 × 60 dpi (dots per inch) to up to 360 × 360 dpi, depending on the number of pins in the print head. The printing speed depends on the printing of adjacent horizontal dots; by not allowing the printing of adjacent dots, you increase the printing speed.

R-66 Sending Graphics Data

n

L

, n

H

Specifies the number of dot columns to follow, determined by the following equation:

(number of dot columns) = ((n

H

× 256) + n

L

) n

H

= INT

( number of dot columns )

256 n

L

= MOD

( number of dot columns )

256

The number of bytes required for each dot column shown below.

Data bytes d

1

. . . d k

You must specify the vertical and horizontal dot density of graphics when sending the ESC * command. The dot densities available are shown in the table below.

Dot density

Parameter m in Horizontal

ESC * command

Vertical density Adjacent Dots per Bytes density 9 pin 24 pin 48 pin dot printing column per column

3

4

5

0

1

2

60

120

120

240

80

72

72

72

72

72

72

72

60

60

60

60

60

N/A

60

60

60

60

60

N/A

Yes

Yes

No

No

Yes

Yes

8

8

8

8

8

8

1

1

1

1

1

1

65

70

71

72

73

6

7

32

33

38

39

40

64

90

144

60

120

90

180

360

60

120

90

180

360

360

72

72

N/A

N/A

N/A

N/A

N/A

N/A

N/A

N/A

N/A

N/A

N/A

60

N/A

180

180

180

180

180

N/A

N/A

N/A

N/A

N/A

N/A

60

N/A

180

180

180

180

180

360

360

360

360

360

360

Yes

Yes

Yes

Yes

Yes

Yes

No

Yes

Yes

Yes

Yes

No

Yes

8

8

24

24

24

24

24

48

48

48

48

48

48

6

6

6

6

6

3

3

3

3

6

1

1

3

Sending Graphics Data R-67

Note:

If the mode you select does not allow adjacent dot printing, the printer ignores the second of two consecutive horizontal dots as shown below:

Preparing bit-image data

Once you have determined the dot density, create a grid for plotting your design.

If the horizontal density is not the same as the vertical density, make a grid that reflects this.

See the sample grids below.

8-dot columns 24-dot columns 48-dot columns

Divide the grid into columns of 1, 3, or 6 bytes, depending on the m parameter of the dot density you select. The illustrations in the next two sections depict the following examples: m = 0 m = 39 m = 72

60 × 60 dpi (60 × 72 dpi for 9-pin printers)

180 × 180 dpi

360 × 360 dpi

R-68 Sending Graphics Data

After plotting the design, divide the grid into groups one dot wide and eight dots high.

The dots in each group have a value, as shown in the following diagram. The sum of each group is sent as a byte of data to the printer. Calculate the value for each byte as shown.

128

64

32

16

8

4

2

1

128

64

32

16

2

1

8

4

128

64

32

16

2

1

8

4

128

64

32

16

2

1

8

4

128

64

32

16

2

1

8

4

Sending Graphics Data R-69

Sending bit-image data to the printer

The order for sending data depends on the mode selected with the m parameter.

The table at the beginning of this section lists the number of bytes of data required for each column.

1 2 3

1 4 7

2 5 8

3 6 9

1 7 13

2 8 14

3 9 15

4 10 16

5 11 17

6 12 18

Count the number of resulting columns in each line. The n

L

and n

H

parameters tell the printer how many columns to expect. Calculate n

L

and n

H

as follows: n

H

= INT

( number of dot columns )

256 n

L

= MOD

( number of dot columns )

256

If you are going to send more than one line of graphics, send the following commands to set the line spacing:

24/48-pin printers

9-pin printers

ESC + 48 48/360-inch line spacing

ESC 3 24 24/216-inch line spacing

This matches the line spacing to the height of the print head. After this, sending the CR and LF commands moves the vertical print position so the next line of graphics begins right where the previous line ended, with no space between.

Now send the data for the first line to the printer as follows:

ESC * 0 n

L

n

H

d

1

d

2

. . . d k

ESC * 39 n

L

n

H

d

1

d

2

. . . d k

ESC * 72 n

L

n

H

d

1

d

2

. . . d k

R-70 Sending Graphics Data

At the end of the line, send the CR and LF commands. Move the horizontal print position as necessary. Then send the ESC * command for the next line of graphics.

Note:

• Since the vertical dot density during 8-dot mode is different for 9 and 24/48pin printers, printed graphics will differ slightly (graphics on 9-pin printers will appear slightly compressed vertically).

• You must send the ESC * command for each line of graphics.

Mixing text and bit-image graphics with ESC/P 2 printers

ESC/P 2

ESC/P 2 printers can process more than one line of data at a time; this allows for advanced features such as scalable fonts and raster graphics.

More memory has been provided for processing data than previous ESC/P versions. By processing data within this memory before printing, mixing bitimage graphics and text of all point sizes is possible.

To provide the most efficient processing of data in the memory available,

ESC/P 2 has the following rules:

• You cannot move the vertical print position more than 179/360 inch (one dot less than 1/2 inch) in the negative direction.

• You cannot move the vertical print position in the negative direction if you have just sent graphics data, or if the print position would move above previously printed graphics data.

Because of these rules, you should process data with text data always leading graphics data by 1/2 inch.

Follow the steps below for this process.

1. Use the ESC + 48 command to set the line spacing to match the print head height.

2. Send the first 1/2 inch of text data to the printer. You can print any combination of fonts (large and small point sizes, etc.) on multiple lines; however, make sure the baseline of all characters is located within this 1/2inch.

3. Use the ESC ( V or ESC ( v commands to move the print position to the top of the 1/2-inch zone.

4. Use the ESC * command to send one line of graphics data (see the previous section). End the graphics line with the CR and LF commands. Note that the height of one line of graphics is equal to the height of the print head (48/360inch).

Sending Graphics Data R-71

5. Move the vertical print position to the bottom of the 1/2-inch zone.

6. Send all text data that has its baseline located in the next 48/360-inch band.

7. Move the vertical print position to 1/360 inch below the bottom of the previous line of graphics.

8. Continue sending alternating 48/360-inch bands of text, then data, with the text leading the graphics by 1/2 inch (as described in steps 4 to 7).

9. When you reach the end of the text data, or the page’s bottom margin, send all the remaining lines of graphics data.

This order allows the printer to store text data in its memory first. Then, when you send the graphics data, the printer prints out the combined data.

Note:

If you don’t follow this order, the tops of some characters may be cut off. This can occur when part of a character overlaps previously printed graphics.

R-72 Sending Graphics Data

Graphics mode

ESC/P 2

ESC/P 2 printers feature a method of printing graphics, called raster graphics. To prevent conflicts with existing commands, EPSON uses a special graphics mode.

You can send raster graphics commands only when in this mode.

Raster graphics gives the programmer a simple, consistent method of printing bit-map images. Raster graphics provides the following advantages:

• Prints images in a consistent manner, regardless of the print head configuration (24 or 48 pins)

• Eliminates necessity for interleaving lines to achieve maximum dot density

• Eliminates complicated calculations for handling data in specific band heights

• Provides for data compression; two bytes of data (a counter byte and a data byte) can specify up to 1,016 dots. Also, repetitive and nonrepetitive data can be sent in the same data string.

Standard raster graphics commands are available to all ESC P/2 printers. An additional set of raster graphics commands, known as extended raster graphics, was developed for EPSON’s line of high-resolution color ink jet printers. This new set of commands provides one additional compressed raster graphics mode, which can be accessed by sending the ESC . 2 command.

Entering and exiting graphics mode

ESC/P 2

Graphics mode is entered by sending the ESC ( G command. The format of the command is as follows:

ESC ( G 1 0 1

You can only enter graphics mode with this command. Use the ESC @ (initialize printer) command to exit graphics mode.

Sending Graphics Data R-73

Commands available in graphics mode

Only the following commands are available in standard raster graphics mode:

LF

CR

ESC .

ESC . 1

ESC . 2

ESC ( c

ESC ( V

ESC $

ESC r

ESC +

FF

ESC EM

ESC @

ESC ( C

ESC ( v

ESC \

ESC U

ESC ( U

ESC ( i

Line feed

Carriage return

Print raster graphics

Enter RLE compressed mode

Enter TIFF compressed mode (Stylus COLOR only)

Set page format

Set absolute vertical position

Set absolute horizontal position

Select printing color

Set n/360-inch line spacing

Form feed

Control paper loading/ejecting

Initialize printer (exit graphics mode)

Set page length in defined unit

Set relative vertical position

Set relative horizontal position

Turn unidirectional on/off

Set unit

MicroWeave (Stylus COLOR only)

The following subset of binary mode commands is available in extended raster graphics mode, entered by sending the ESC . 2 command. All other commands are ignored.

<XFER>

<MOVX>

<MOVY>

<COLR>

<CR>

<EXIT>

<MOVXBYTE>

<MOVXDOT>

Transfer raster graphics data

Set relative horizontal position

Set relative vertical position

Select printing color

Carriage return to left-most print position

Exit TIFF compressed mode

Set <MOVX> unit to 8 dots

Set <MOVX> unit to 1 dot

Other commands not listed above are ignored. Also, text cannot be sent during graphics mode.

Standard raster graphics

ESC/P 2

Raster graphics allows the programmer to send image data in a format similar to that used by televisions, VDT monitors, and laser printers.

Follow these steps to prepare and send raster graphics:

1. Determine the dot density (resolution) of your image.

R-74 Sending Graphics Data

2. Use the ESC ( U command to set the unit to match the vertical dot density selected.

3. Divide your image into bands. These bands should be 1, 8, or 24-dots high.

Parameter m in the ESC . command should be set to this value.

4. Use the ESC + command to set line spacing to match the height of the vertical band. If you select 360-dpi dot density, the parameter for the ESC + command is the same as parameter m in the ESC . command. If you select 180, the ESC

+ parameter equals m × 2.

5. Set the vertical and horizontal positions to begin the first graphics band.

6. Use the ESC . command to send a graphics band m dots high.

7. Send the CR and LF commands at the end of each block; then move the horizontal position to the beginning of the next graphics band.

8. Repeat steps 6 and 7 until all graphics data is sent for the page.

9. Send a FF command at the end of the page.

10. Repeat steps 6 to 9 for all pages in the print job.

The format of the ESC . (standard raster graphics) command is as follows:

ESC . c v h m n

L

n

H

d

1

d

2

. . . d k c = 0 Selects full graphics mode; all data bytes are treated as print data

1 v

Selects run length encoded compressed mode; data treated as follows: counter byte, data, counter byte, data

Specifies vertical dot density (independent of number of pinsin head) h m n d

L

1

, n

H

. . . d k

(vertical dot density) =

3600 v

dpi

Specifies horizontal dot density (independent of number of pins in head)

(horizontal dot density) =

3600 h

dpi

Specifies vertical dot count (1, 8, or 24)

Specifies horizontal dot count

(horizontal dot count) = ((n

H

× 256) + n

L

)

Data or counter/data combination

Sending Graphics Data R-75

The vertical and horizontal dot densities that can be selected are as follows: h

20

10

10 v

20

20

10 horizontal density vertical density

180

360

360

180

180

360

Once you have decided the dot density, use the ESC ( U to set the unit to match the vertical dot density.

ESC ( U 1 0 10

ESC ( U 1 0 20

Next, create a grid for plotting your design. If the horizontal density is not the same as the vertical density, make a grid that reflects this.

See the sample grid below.

Selects 1/360-inch unit

Selects 1/180-inch unit

After plotting the design, divide the grid into groups one dot high and eight dots wide.

The dots in each group have a value, as shown in the following diagram.

Calculate the value for each group as shown.

R-76 Sending Graphics Data

64 + 16 + 2 = 82 32 + 2 = 34 4 + 2 + 1 = 7

Divide your image into bands 1, 8, or 24-dots high. The number of vertical dots is called the band height. This is the value you should use for parameter m in the

ESC . command.

Sending Graphics Data R-77

The band height affects the following:

• The taller the band height, the more memory you must prepare in your program to accomodate graphics data.

• The band height determines the number of times you must send the ESC .

command. You must resend the ESC . command for each band of graphics you print. The taller the band height, the less number of ESC . commands you need to send.

The following table gives you an idea of how much memory is required for band heights at certain standard widths.

Band width

8 inches

11 inches

14 inches

Bytes required for band heights at

180-dpi horizontal dot density

1-dot band height

180

248

315

8-dot band height

1,440

1,984

2,520

24-dot band height

4,320

5,952

7,560

Bytes required for band heights at

360-dpi horizontal dot density

1-dot band height

360

495

630

8-dot band height

2,880

3,960

5,040

24-dot band height

8,640

11,880

15,120

Use the ESC + command to set line spacing to match the band height. The following table shows the command format for each band height.

ESC + command setting

ESC + 1

ESC + 2

ESC + 8

ESC + 16

ESC + 24

ESC + 48

Vertical dot density (dpi)

360

180

360

180

360

180

Band height

(dots)

1

1

8

8

24

24

Band height

(inches)

1/360

2/360

8/360

16/360

24/360

48/360

Parameter m in

ESC . command

1

1

8

8

24

24

R-78 Sending Graphics Data

Before sending data, you must also determine the width of your graphics image.

The width is also specified in number of dots. Of course, data must be sent in bytes; all data beyond the dot width specified is ignored.

The following illustration shows the dot width and the ignored data.

Ignored data

19-dot width n

H

= 0, n

L

= 19

Determine the dot-width parameters for the ESC . command as follows: n

H

= INT

( dot width )

256 n

L

= MOD

( dot width )

256

Use a combination of the ESC ( V, ESC ( v, ESC $, or ESC \ commands to set the beginning position of the first graphics band. The print position corresponds to the position of the first printable dot in your image.

First print position Final print position

Sending Graphics Data R-79

You are now ready to send data with the ESC . command.

The method of sending data in standard raster graphics mode depends on whether you select full graphics (ESC.0) or compressed mode (ESC . 1). For a discussion of extended raster graphics compressed modes, see “Extended raster graphics (ESC . 2).”

Full graphics mode (ESC . 0)

ESC/P 2

If you set the ESC . command’s parameter c to 0, you select full graphics mode.

During full graphics mode, all data received is treated as print data.

Note:

Full graphics mode requires more data to be sent. Use compressed raster graphics mode whenever possible.

During full graphics mode, simply divide the image grid into bytes and send the bytes one after another, in the following order.

After sending the data for the graphics band, send a CR and LF command.

R-80 Sending Graphics Data

Standard raster graphics compressed mode (ESC . 1)

ESC/P 2

The method of sending data in standard raster graphics compressed mode is slightly more complicated. However, the amount of data necessary to print graphics may be greatly reduced. When possible, you should use one of the available compressed modes. For information on extended raster graphics compressed modes, see “Extended raster graphics (ESC . 2).”

Data is organized as counter bytes followed by data bytes. Two types of counters can be used: repeat counters and data-length counters.

Repeat counters specify the number of times (minus 1) to repeat the following single byte of data.

Data-length counters specify the number of bytes (minus 1) of print data following the counter. This data is printed only once.

If the counter is positive, it is treated as a data-length counter.

0 ≤ (data-length counter) ≤ 127

The data-length counter is calculated as follows:

(data-length counter) = (number of data bytes to follow) – 1

If the counter is negative (as determined by two’s complement), it is treated as a repeat counter.

–1 ≤ (repeat counter) ≤ –127

The repeat counter is calculated as follows:

(repeat counter) = 256 – (number of times to repeat data) + 1

During compressed mode, the first byte of data must be a counter. After receiving a counter, the printer handles data as follows:

If a repeat counter is received, the printer repeats the following byte of data the specified number of times. The byte following the data byte is treated as a counter.

Repeats this one byte of data 11 times

ESC .

10 8 48 0 –10 129 15 . . .

First counter byte Second counter byte

Sending Graphics Data R-81

15

15

22

128

8

103

97

15

If a data-length counter is received, the printer prints the specified number of bytes. The next byte following the data is treated as a counter.

Prints next 5 bytes as data

↓ ↓ ↓ ↓ ↓

ESC .

1 10 10 8 48 0 4 10 129 100 63 48 –10 . . .

First counter byte

Second counter byte

Since the printer evaluates each counter separately, you can include both kinds of counters in the same ESC . 1 command sequence. However, the total amount of print data must match the length and height of the graphics band.

Note:

If your image has consecutive blank spaces, use the repeat counter to send repetitive bytes of NUL data (bytes with value of 0). This can greatly reduce the amount of data necessary for printing some images.

During compressed mode, divide the image grid into bytes just as with full graphics mode. However, you then separate repetitive data bytes from nonrepetitive bytes. Shaded areas indicate repetitive data bytes.

0

0

13

44

60

14

0

32

90

99

0

9

30 128

155 155

60

27

15

37

63

15

34 173

0

0

25

0

37

110 109

0

14

155 155

15

0

16

63

15

79

97

15

91

0 0

88 103

97 22

15 15

42

22

15

92

0

77

31

15

15

0

15

8

53

0

128

0

0

61

97

0

The ESC . 1 command would be as follows for the example above.

ESC . 1 10 10 8 72 0

After sending the following data (shaded data bytes are counters), send a CR or

LF command.

60

53

–3

32

–11

77

22

0

90

14

0

9

0

61

31

0

30 128 37

99 155 155

0 60 –4

27

18

13

97

34

37

25

44

173

14

91

16

155 155

110

79

63

15

109

42

97

8

92

88

63

–4

R-82 Sending Graphics Data

Extended raster graphics (ESC . 2)

ESC/P 2

Extended raster graphics provides one data compression mode: TIFF (ESC . 2).

For more information on programming with this command, see “Extended

ESC/P 2 Programming Guide” later in this section.

A brief explanation of each mode is given below.

TIFF compressed mode (ESC . 2)

Uses the TIFF compression format. Image data for each color is written to the band buffer (of the current line) and has no effect on the next line. Image data must be sent for each line. The compression method is the same as that used in the RLE compressed mode (ESC . 1), which means that image data is sent in the

“counter + image data” format. Although both compression methods use the same amount of image data, the amount of code data required by each method varies markedly. The TIFF mode uses a subset of binary commands that require much less data than the corresponding ESC commands used in the RLE mode.

For example, the print position, color selection, and other operation codes can be specified with only 1 to 3 bytes in the TIFF mode, thereby reducing the overall amount of data sent to the printer. The TIFF mode provides a good balance between data handling speed and the amount of data compression, making it ideal for printing small graphics files.

An example of the data compression methods used in extended raster graphics mode is shown below. For more information, see the explanation of each command in Individual Command Descriptions.

Sample graphics image (3 lines, 3 × 24 dots)

1st byte 2nd byte

1st line

2nd line

3rd line

Sample graphics image expressed as byte data

1st line

2nd line

3rd line

1st byte

F0H

F0H

F0H

2nd byte

F0H

F0H

AAH

3rd byte

3rd byte

F0H

F0H

AAH

TIFF compressed mode

After sending ESC . 2 v h 1 0 0 (8 bytes) once to enter TIFF compressed mode, following data is sent in the “binary code data + image data” format, and can be used to print several lines. In this mode, all image data must be sent again even if the following line is identical to the previous one. For example, to print the first and second lines in the above example, 4 bytes (3 × F0H (twice)) of image data are needed. The total amount of data used to send the graphics image sample shown above is as follows:

2 bytes (image data of 1st line) + 9 bytes (code data of 1st line) + 2 bytes

(image data of 2nd line) + 2 bytes (code data of 2nd line) + 4 bytes (image data of 3rd line) + 2 bytes (code data of 3rd line) = 21 bytes

Sending Graphics Data R-83

Printing Bar Codes

ESC/P 2 ESC/P 9-Pin ESC/P

Barcode print is available on DLQ-3000(‘96-), LQ-670, LQ-2070, LQ-2170, FX-2170 and later impact dot matrix models.

The ESC ( B command is used to print barcodes. The format of this command is as follows:

ESC ( B n

L

n

H

k m s v

1

v

2

c BarCodeData n

L

n

H

Specify the number of data bytes to follow, determined by the following equation:

(number of data bytes) = 6 bytes + BarCodeData bytes = ((n

H

× 256) + n

L

)

(where 6 bytes are k, m, s, v

1

, v

2

, and c) n

H

= INT

( number of data bytes )

256 n

L

= MOD

( number of data bytes )

256

The parameter k specifies the barcode type.

k (Hex)

00

01

02

03

Bar code type

EAN-13

EAN-8

Interleaved 2 of 5

UPC-A

04

05

06

07

UPC-E

Code 39

Code 128

POSTNET

The parameter m specifies the module width.

m 24-pin printer

(unit 1/180 inch)

9-pin printer

(unit 1/120 inch)

02 (default)

03

04

05

2 dots

3 dots

4 dots

5 dots

2 dots

3 dots

4 dots

5 dots

The parameter s specifies the space adjustment value.

24-pin printer

9-pin printer

-3

s

3 (unit 1/360 inch)

-3

s

3 (unit 1/240 inch)

The parameter v

1

and v

2

specifies the bar length.

24-pin printer bar length = v

1

+ v

2

×

256 (unit 1/180 inch)

9-pin printer bar length = v

1

+ v

2

×

256 (unit 1/72 inch)

The limitation of bar length:

45/180 inch

bar length

22 inch : 24-pin printer

18/72 inch

bar length

22 inch : 9-pin printer

The v1 and v2 values are ignored when POSTNET is selected.

Long bar length of POSTNET is always 0.125 inch.

Short bar length of POSTNET is always 0.050 inch.

R-84 Printing Bar Codes

The parameter c specifies the control flag.

c Control flag bit 0 Check digit

0: If check digit is to be printed, the host generates it and sends it to the printer

1: Printer generates and prints the check digit

Bit 1

Bit 2

Human readable character

0: Prints

1: Does not print

Position of flag character (for EAN-13 and UPC-A only)

0: Center

1: Under bit 3 bit 4 bit 5 bit 6 bit 7

(reserved)

(reserved)

(reserved)

(reserved)

(reserved)

Barcode Data Corresponds to the bar code symbology.

The data number of each bar code type is constant.

The bar code is not printed if the number of bar code characters are incorrect.

Bar code type

EAN-13

EAN-8

Interleaved 2 of 5

UPC-A

UPC-E

Code 39

Code 128

POSTNET

Actual number of Barcode Data (HEX) control flag c bit 0

= 0

0D control flag c bit 0

= 1

0C

08

02 to FF

0C

0C or 8

01 to FF

02 to FF

06 or 0A or 0C

07

02 to FF

0B

0B or 7

01 to FF

02 to FF

05 or 09 or 0B

The valid data of each bar code type are as follows.

If invalid data is included in the Barcode Data string, the bar code is not printed.

Bar code type Valid range of BarCodeData

EAN-13

EAN-8

0-9 (30H-39H)

0-9 (30H-39H)

Interleaved 2 of 5 0-9 (30H-39H)

UPC-A

UPC-E

Code 39

Code 128

POSTNET

0-9 (30H-39H)

0-9 (30H-39H)

0-9 (30H-39H), (41H-5AH)

(20H, 24H, 25H, 2BH, 2DH, 2EH, 2FH)

See the code sets A, B, and C on the following pages.

0-9 (30H-39H)

Printing Bar Codes R-85

Data Character Set A:

NAK

SYN

ETB

CAN

EM

SUB

ESC

FS

GS

RS

US

SI

DLE

DC1

DC2

DC3

DC4

LF

VT

FF

CR

SO

Character Hex Code Character Hex Code Character Hex Code Character Hex Code

NUL x00 Space x20 ‘@’ x40 FNC 3 x60

OH x01 ‘!’ x21 ‘A’ x41 FNC 2 x61

STX

EXT x02 x03

‘"’

‘#’ x22 x23

‘B’

‘C’ x42 x43

Shift

Code C x62 x63

EOT

ENO

ACK

BEL

BS

HT x04 x05 x06 x07 x08 x09

‘$’

‘%’

‘&’

‘'’

‘(’

‘)’ x24 x25 x26 x27 x28 x29

‘D’

‘E’

‘F’

‘G’

‘H’

‘I’ x44 x45 x46 x47 x48 x49

Code B

FNC 4

FNC 1

— x64 x65 x66

— x0A x0B x0C x0D x0E x0F x10 x11 x12 x13 x14

‘*’

‘+’

‘,’

‘-’

‘.’

‘/’

‘0’

‘1’

‘2’

‘3’

‘4’ x2A x2B x2C x2D x2E x2F x30 x31 x32 x33 x34

‘J’

‘K’

‘L’

‘M’

‘N’

‘O’

‘P’

‘Q’

‘R’

‘S’

‘T’ x4A x4B x4C x4D x4E x4F x50 x51 x52 x53 x54

— x15 x16 x17 x18 x19 x1A x1B x1C x1D x1E x1F

‘8’

‘9’

‘:’

‘5’

‘6’

‘7’

‘;’

‘<’

‘=’

‘>’

‘?’ x35 x36 x37 x38 x39 x3A x3B x3C x3D x3E x3F

‘U’

‘V’

‘W’

‘X’

‘Y’

‘Z’

‘[’

‘\’

‘]’

‘^’

‘_’ x55 x56 x57 x58 x59 x5A x5B x5C x5D x5E x5F

R-86 Printing Bar Codes

Data Character Set B:

Character Hex Code Character Hex Code Character Hex Code Character Hex Code

Space x20 ‘@’ x40 x60

‘!’ x21 ‘A’ x41 ‘a’ x61

‘"’

‘#’ x22 x23

‘B’

‘C’ x42 x43

‘b’

‘c’ x62 x63

‘$’

‘%’

‘&’

‘'’

‘(’

‘)’ x24 x25 x26 x27 x28 x29

‘D’

‘E’

‘F’

‘G’

‘H’

‘I’ x44 x45 x46 x47 x48 x49

‘d’

‘e’

‘f’

‘g’

‘h’

‘i’ x64 x65 x66 x67 x68 x69

‘2’

‘3’

‘4’

‘/’

‘0’

‘1’

‘*’

‘+’

‘,’

‘-’

‘.’ x2A x2B x2C x2D x2E x2F x30 x31 x32 x33 x34

‘J’

‘K’

‘L’

‘M’

‘N’

‘O’

‘P’

‘Q’

‘R’

‘S’

‘T’ x4A x4B x4C x4D x4E x4F x50 x51 x52 x53 x54

‘j’

‘k’

‘l’

‘m’

‘n’

‘o’

‘p’

‘q’

‘r’

‘s’

‘t’ x6F x70 x71 x72 x73 x74 x6A x6B x6C x6D x6E

FNC 3

FNC 2

Shift

Code C

FNC 4

Code A

FNC 1 x19 x1A x1B x1C x1D x1E x1F

‘5’

‘6’

‘7’

‘8’

‘9’

‘:’

‘;’

‘<’

‘=’

‘>’

‘?’ x35 x36 x37 x38 x39 x3A x3B x3C x3D x3E x3F

‘U’

‘V’

‘W’

‘X’

‘Y’

‘Z’

‘[’

‘\’

‘]’

‘^’

‘_’ x55 x56 x57 x58 x59 x5A x5B x5C x5D x5E x5F

‘u’

‘v’

‘w’

‘x’

‘y’

‘z’

‘{’

‘/’

‘}’

‘¯’

DEL x75 x76 x77 x78 x79 x7A x7B x7C x7D x7E x7F

Printing Bar Codes R-87

Data Character Set C:

‘21’

‘22’

‘23’

‘24’

‘25’

‘26’

‘27’

‘28’

‘29’

‘30’

‘31’

‘15’

‘16’

‘17’

‘18’

‘19’

‘20’

‘10’

‘11’

‘12’

‘13’

‘14’

Character Hex Code Character Hex Code Character Hex Code Character Hex Code

‘00’ x3030 ‘32’ x3332 ‘64’ x3634 ‘96’ x3936

‘01’ x3031 ‘33’ x3333 ‘65’ x3635 ‘97’ x3937

‘02’

‘03’ x3032 x3033

‘34’

‘35’ x3334 x3335

‘66’

‘67’ x3636 x3637

‘98’

‘99’ x3938 x3939

‘04’

‘05’

‘06’

‘07’

‘08’

‘09’ x3034 x3035 x3036 x3037 x3038 x3039

‘36’

‘37’

‘38’

‘39’

‘40’

‘41’ x3336 x3337 x3338 x3339 x3430 x3431

‘68’

‘69’

‘70’

‘71’

‘72’

‘73’ x3638 x3639 x3730 x3731 x3732 x3733

Code B

Code A

FNC 1

— x3A x3B x3C

— x3130 x3131 x3132 x3133 x3134 x3135 x3136 x3137 x3138 x3139 x3230

‘42’

‘43’

‘44’

‘45’

‘46’

‘47’

‘48’

‘49’

‘50’

‘51’

‘52’ x3432 x3433 x3434 x3435 x3436 x3437 x3438 x3439 x3530 x3531 x3532

‘74’

‘75’

‘76’

‘77’

‘78’

‘79’

‘80’

‘81’

‘82’

‘83’

‘84’ x3734 x3735 x3736 x3737 x3738 x3739 x3830 x3831 x3832 x3833 x3834

— x3231 x3232 x3233 x3234 x3235 x3236 x3237 x3238 x3239 x3330 x3331

‘53’

‘54’

‘55’

‘56’

‘57’

‘58’

‘59’

‘60’

‘61’

‘62’

‘63’ x3533 x3534 x3535 x3536 x3537 x3538 x3539 x3630 x3631 x3632 x3633

‘85’

‘86’

‘87’

‘88’

‘89’

‘90’

‘91’

‘92’

‘93’

‘94’

‘95’ x3835 x3836 x3837 x3838 x3839 x3930 x3931 x3932 x3933 x3934 x3935

R-88 Printing Bar Codes

Print position:

A bar code is placed the left upper end of a bar code to the current vertical and horizontal print position. Also printing position after the printing of a bar code returns to the print position before bar code printing.

Horizont l

Print position and next

Ver ical print position

Notes:

(1) Bar code printing is always performed uni-directionally.

(2) The bar code is not printed when part of the bar code is past the right margin.

(3) Start/stop characters(*) of Code39 are generated automatically by the printer, and added to human readable characters.

(4) A kind of Code 128 character sets (A, B or C) is identified by the first data of

Code 128. The first data must be a hexadecimal 41 (A), 42 (B) and 43 (C).

(5) When Code 128 Character Set C and Interleaved 2 of 5 is selected and the number of Barcode data are ODD, “0” is added to the data string.

Printing Bar Codes R-89

Examples: example 1: EAN-13, CD: Host, HRI: print, Flag Char.: center

1B 28 42 13 00

(CD: Check digit, HRI: Human Readable character)

; Barcode command and data length

00

02

00

7D 00

00

30 31 32 33 34 35 36

37 38 39 30 31 32 ;

; Barcode type k = EAN-13

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

; Barcode Data example 2: EAN-13, CD: Printer, HRI: print, Flag Char.: under

1B 28 42 12 00 ; Barcode command and data length

00

02

00

7D 00

05

31 32 33 34 35 36

37 38 39 30 31 32

; Barcode type k = EAN-13

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

; Barcode Data example 3: EAN-13, CD: Printer, HRI: none, Flag Char.: under

1B 28 42 12 00

00

02

00

7D 00

03

31 32 33 34 35 36

37 38 39 30 31 32

; Barcode command and data length

; Barcode type k = EAN-13

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

; Barcode Data

R-90 Printing Bar Codes

example 4: EAN-8, CD: Host, HRI: print

1B 28 42 0E 00

01

02

00

; Barcode command and data length

; Barcode type k = EAN-8

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

7D 00

00

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

30 31 32 33 34 35 36 35 ; Barcode Data example 5: EAN-8, CD: Printer, HRI: none

1B 28 42 0D 00 ; Barcode command and data length

01

02

00

7D 00

03

30 31 32 33 34 35 36

; Barcode type k = EAN-8

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

; Barcode Data example 6: Interleaved 2 of 5, CD: Host, HRI: print

1B 28 42 1A 00 ; Barcode command and data length

02

02

00

7D 00

00

31 32 33 34 35 36 37

38 39 30 31 32 33 34

35 36 37 38 39 30 ;

; Barcode type k = Interleaved 2 of 5

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

;

; Control flags c

; Barcode Data

Printing Bar Codes R-91

example 7: Interleaved 2 of 5, CD: Printer, HRI: none

1B 28 42 19 00

02

02

00

; Barcode command and data length

; Barcode type k = Interleaved 2 of 5

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

7D 00

03

31 32 33 34 35 36 37

38 39 30 31 32 33 34

35 36 37 38 39 ;

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

;

; Barcode Data example 8: Interleaved 2 of 5, CD: Host, HRI: print

Next example is that ‘0’ is added automatically, in the case that the data number is odd.

1B 28 42 19 00

02

02

00

7D 00

00

31 32 33 34 35 36 37

38 39 30 31 32 33 34

35 36 37 38 39 ;

;

; Barcode command and data length

; Barcode type k = Interleaved 2 of 5

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

; Barcode Data example 9: UPC-A, CD: Host, HRI: Print, Flag Char.: center

1B 28 42 12 00 ; Barcode command and data length

03

02

00

7D 00

00

30 31 32 33 34 35 36

37 38 39 30 35

; Barcode type k = UPC-A

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

;

; Control flags c

; Barcode Data

R-92 Printing Bar Codes

example 10: UPC-A, CD: Printer, HRI: print, Flag Char.: under

1B 28 42 11 00

03

02

00

; Barcode command and data length

; Barcode type k = UPC-A

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

7D 00

05

31 32 33 34 35 36

37 38 39 30 31

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

;

; Barcode Data example 11: UPC-A, CD: Printer, HRI: none, Flag Char.: center

1B 28 42 11 00

03

02

00

7D 00

03

31 32 33 34 35 36

; Barcode command and data length

; Barcode type k = UPC-A

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

; Barcode Data

37 38 39 30 31 ; example 12: UPC-E, CD: Host, HRI: print

Next example is that of barcode data compacted in accordance with specifications by the printer.

1B 28 42 12 00

04

02

00

7D 00

00

30 31 32 33 34 35 36

37 38 39 30 35 ;

; Barcode command and data length

; Barcode type k = UPC-E

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

; Barcode Data

Printing Bar Codes R-93

example 13: UPC-E, CD: Printer, HRI: none

Next example is that of the barcode data compacted in accordance with specifications by the printer.

1B 28 42 11 00

04

02

00

7D 00

03

31 32 33 34 35 36

37 38 39 30 31 ;

; Barcode command and data length

; Barcode type k = UPC-E

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

; Barcode Data example 14: UPC-E, CD: Host, HRI: print

1B 28 42 0E 00

04

02

00

7D 00

00

30 31 32 33 34 35

30 33 ;

; Barcode command and data length

; Barcode type k = UPC-E

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

; Barcode Data example 15: UPC-E, CD: Printer, HRI: print

1B 28 42 0D 00

04

02

00

7D 00

01

30 31 32 33 34 35 30

; Barcode command and data length

; Barcode type k = UPC-E

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

; Barcode Data

R-94 Printing Bar Codes

example 16: UPC-E, CD: printer, HRI: none

1B 28 42 0D 00

04

02

00

; Barcode command and data length

; Barcode type k = UPC-E

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

7D 00

03

30 31 32 33 34 35 30

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

; Barcode Data example 17: Code 39, CD: host, HRI: print

1B 28 42 0D 00 ; Barcode command and data length

05

02

00

7D 00

00

31 32 41 42 24 25 2E

; Barcode type k = Code 39

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

; Barcode Data example 18: Code 39, CD: Printer, HRI: print

1B 28 42 0D 00 ; Barcode command and data length

05

02

00

7D 00

01

31 32 41 42 24 25 2E

; Barcode type k = Code 39

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

; Barcode Data

Printing Bar Codes R-95

example 19: Code 39, CD: Printer, HRI: none

1B 28 42 0D 00

05

02

00

; Barcode command and data length

; Barcode type k = Code 39

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

7D 00

03

31 32 41 42 24 25 2E

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

; Barcode Data example 20: Code 128, CD: Printer, HRI: print, using Data Character Set A

1B 28 42 10 00 ; Barcode command and data length

06

02

00

7D 00

01

41 32 33 40 41 21 43

44 5B 5D

; Barcode type k = Code 128

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

;

; Control flags c

; Barcode Data example 21: Code 128, CD: Printer, HRI: print, using Data Character Set B

1B 28 42 10 00

06

02

00

7D 00

01

42 32 33 40 61 42 63

44 5B 5D

; Barcode command and data length

; Barcode type k = Code 128

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

;

; Barcode Data

R-96 Printing Bar Codes

example 22: Code 128, CD: Host, HRI: none, using Data Character Set B

1B 28 42 10 00

06

02

00

; Barcode command and data length

; Barcode type k = Code 128

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

7D 00

02

42 32 33 40 61 42 63

44 5B 5D

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

;

; Barcode Data example 23: Code 128, CD: Host, HRI: print, using Data Character Set C

1B 28 42 11 00

06

02

00

7D 00

00

43 30 31 32 33 34 35

; Barcode command and data length

; Barcode type k = Code 128

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

; Barcode Data

36 37 38 39 ; example 24: Code 128, CD: Host, HRI: print, using Data Character Set C

Next example is of ‘0’ added automatically, in the case of oddnumbered data.

1B 28 42 10 00 ; Barcode command and data length

06

02

00

7D 00

00

43 31 32 33 34 35

36 37 38 39

; Barcode type k = Code 128

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length v1, v2 = 125 / 180 inch

;

; Control flags c

; Barcode Data

Printing Bar Codes R-97

example 25: Code 128, CD: Host, HRI: print, mixed Data Character Set A, B and C

1B 28 42 14 00

06

02

00

; Barcode command and data length

; Barcode type k = Code 128

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

7D 00

00

; Bar length v1, v2 = 125 / 180 inch

; Control flags c

41 30 62 61 64 70 1C ; Barcode Data

37 39 3A 62 1B 3D 61 ; example 26: POSTNET, CD: Host

1B 28 42 10 00

07

02

00

00 00

00

31 32 33 34 35 36 37

38 39 30

; Barcode command and data length

; Barcode type k = POSTNET

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length value v1 and v2 are ignored. POSTNET

uses the fixed bar length.

; Control flags c

; Barcode Data example 27: POSTNET, CD: Printer

1B 28 42 0F 00

07

02

00

00 00

; Barcode command and data length

; Barcode type k = POSTNET

; Module width m = 2 dots / 180 inch

; Space adjustment value s = +0 dots / 360 inch

; Bar length value v1 and v2 are ignored. POSTNET

uses the fixed bar length.

01

31 32 33 34 35 36 37

38 39

; Control flags c

; Barcode Data

R-98 Printing Bar Codes

Extended ESC/P 2 Programming Guide

To accommodate the high-resolution color graphics available to the Stylus

COLOR and later inkjet printer models, EPSON has expanded the ESC/P 2 command set. The Stylus COLOR and later high-resolution ink jet printers are fully EPSON ESC/P 2 compliant. They support four multipoint fonts, the new

MicroWeave command, and four raster graphics modes:

Standard raster graphics

Uncompressed raster graphics printing (ESC . 0)

Compressed raster graphics—Run Length Encoding (RLE) (ESC . 1)

Extended raster graphics (Stylus COLOR and later inkjet models only)

Compressed raster graphics—TIFF (ESC . 2)

To select one of these four raster graphics modes, set the c parameter in the print raster graphics command ESC . c v h m n

L

n

H

d

1

. . . d k

as follows:

1

2 c

0 mode

Uncompressed raster graphics

RLE compression

TIFF compression

The TIFF mode command is only implemented in the Stylus COLOR and later inkjet model printers. These commands also make use of a subset of binary mode commands new to the ESC/P 2 command language. The Stylus COLOR is, of course, backward compatible with the ESC/P command language. To make full use of the new commands and features supported by the Stylus COLOR, we suggest writing an ESC/P 2 color printer driver specifically for this model. In addition, all future color printers, both ink jets and SIDMs, will include the expanded ESC/P 2 commands. By incorporating a new color printer driver in your application, you will be able to take full advantage of the program’s powerful color features when printing with EPSON’s high-resolution printers.

MicroWeave technology

The MicroWeave feature added to the ESC/P 2 command set reduces the banding—uniform horizontal lines in graphics—usually associated with serial printers. The command syntax is ESC ( i 01 00 n, where n = 0 MicroWeave off

(default), and n = 1 MicroWeave on. Banding is caused by the misalignment of printed dots at the boundary of two adjacent raster bands owing to mechanical limitations of the printer. MicroWeave technology compensates for these limitations by moving the print head in smaller vertical increments than the height of a non-MicroWeave raster band and firing the nozzles in a staggered sequence. This process shortens the band heights, making them less distinct.

To use MicroWeave, the band height (m) in the ESC . command must be set to 1.

This feature also increases printing time, but it completely eliminates banding and yields sharp, near photographic-quality color images. For more information about this command, see its description in Individual Command Explanations.

Extended ESC/P 2 Programming Guide R-99

Monochrome printing support

Black and white printing support for the Stylus COLOR can be achieved most easily by renaming an existing ESC/P 2 monochrome driver. The ESC/P 2 command language implements four scalable multipoint fonts: Roman, Sans

Serif, Roman T, and Sans Serif H not available to ESC/P printers. In addition,

ESC/P 2 printers support compressed graphics printing. In the monochrome multipoint mode, the Stylus COLOR printer supports the same four multipoint fonts available to current EPSON ESC/P 2 printers, including the LQ-150

(ActionPrinter 3260), LQ-570+ (ActionPrinter 5000+), LQ-1070+, Stylus 400,

Stylus 800+, Stylus 1000, Stylus 800, and Stylus 300. However, in order to access the new extended raster graphics compressed modes, the driver should incorporate the latest ESC/P 2 commands, including ESC . 2.

Color bit-image graphics support

The best way to support color printing on the Stylus COLOR is to write a new driver that includes all of the expanded ESC/P 2 commands available to the

Stylus COLOR and other high-resolution EPSON printers. A simpler although less desirable method of supporting color printing would be to rename an existing ESC/P color driver. Driver examples include the LQ-860 or LQ-2550.

This method would support the Stylus COLOR as an older ESC/P bit-image printer but would seriously limit its high-resolution printing capabilities and deny access to other advanced features such as multipoint fonts, raster graphics data compression (RLE or TIFF), and MicroWeave.

ESC/P 2 color multipoint font support

Color multipoint font ESC/P 2 drivers can be developed by adding the select print color command (ESC r n) to existing black and white ESC/P 2 drivers. In multipoint mode, insert the select print color command using the values below.

1

2

3 n

0

4

5

6 color

Black (default)

Magenta

Cyan

Violet

Yellow

Red

Green

The Stylus COLOR uses process color inks—Cyan, Magenta, Yellow, and Black

(CMYK)—to produce other colors, including Violet, Red, and Green. Existing printer drivers that can be modified to support color multipoint fonts are the LQ-

150 (ActionPrinter 3260), LQ-570+ (ActionPrinter 5000+), LQ-1070+, Stylus 400,

Stylus 800+, Stylus 1000, Stylus 800, and Stylus 300. For more information, see programming Example 1: ESC/P 2 color multipoint font driver. Also see the ESC r command description in Individual Command Explanations.

R-100 Extended ESC/P 2 Programming Guide

ESC/P 2 MicroWeave color raster graphics and RLE compressed raster graphics

Color raster graphics printing with MicroWeave requires the addition of the

MicroWeave command “ESC ( i 01 00 n” and the select color command “ESC r n” to an existing monochrome raster graphics driver. Only four colors are available when printing raster graphics.

n

0

1

2

4 color

Black (default)

Magenta

Cyan

Yellow

Note:

If you change the selected colors after entering raster graphics mode, the data buffer will be flushed.

Any of the following printer drivers can be modified to support MicroWeave color raster graphics printing: Stylus 400, Stylus 800+, Stylus 1000, Stylus 800,

Stylus 300, LQ-570+ (ActionPrinter 5000+), LQ-1070+, LQ-150 (ActionPrinter

3260), and LQ-100 (ActionPrinter 3250). This mode can access the highest printing resolution (720 by 720 dpi) featured on EPSON’s latest color ink jet printers, such as the Stylus COLOR. See Example 2: MicroWeave ESC/P 2 color raster graphics and RLE compressed raster graphics driver for more information.

ESC/P 2 MicroWeave color extended raster graphics—TIFF

With the introduction of the Stylus COLOR, new compression method—TIFF— has been added to the existing ESC/P 2 graphics command set. To enter TIFF compressed mode, select the ESC . 2 extended raster graphics command. This compression architecture saves up to five bytes of overhead per raster line.

Note:

In TIFF compressed mode, the band height (m) must always be set to 1. In this setting, one raster line prints at a time.

The new compression mode supports the Stylus COLOR’s and later inkjet printers’ maximum resolution of 720 by 720 dpi and MicroWeave. The ESC . 2 extended raster graphics compression commands make use of a subset of binary mode commands new to ESC/P 2. These commands, which reduce the amount of code data that must be sent to the printer, are explained below.

Extended ESC/P 2 Programming Guide R-101

Binary mode commands

The following binary commands are applicable to the TIFF compressed mode. All other commands are ignored after entering extended raster graphics.

<XFER>

<MOVX>

<MOVY>

<COLR>

<CR>

<EXIT>

<MOVXBYTE>

<MOVXDOT>

Transfer raster graphics data

Set relative horizontal position

Set relative vertical position

Select printing color

Carriage return to left-most print position

Exit TIFF compressed mode

Set <MOVX> unit to 8 dots

Set <MOVX> unit to 1 dot

The binary mode commands are divided into three classes:

Class

1

2

3

Description command without parameter command with parameter command with parameter and data

Bit assignments

Bit assignments for the binary mode commands are as follows:

Class 1 commands (without parameter)

Bits 0–3 Command ID

Bit 4

Bits 5–7

Flag bit

Opcode

Class 2 commands (with parameter)

Bits 0–3 Parameter or counter

Bit 4

Bits 5–7

Flag bit

Opcode

Class 3 commands (with parameter and data)

Bits 0–3 Definition changes based on bit 4

Bit 4 = 0 Bits 0–3 are twos complement parameter

Bit 4 = 1 Bits 0–3 are parameter byte count

Bits 5–7 Opcode

R-102 Extended ESC/P 2 Programming Guide

Class

1

System level commands

Command

<CR>

High nibble

Low nibble

Description

1110 0010 Move to left most position (x = 0)

1 <EXIT> 1110 0011 Exit TIFF binary mode

1 <MOVXBYTE> 1110 0100 Horizontal (x) moves are in bytes

1 <MOVDOT> 1110 0101 Horizontal (x) moves are in dots

Class

2

Movement commands

Command

<MOVX>

High nibble

Low nibble

Description

0100 Count Move –8 to +7 units (dots/bytes), default is dots

2

2

2

<MOVX>

<MOVY>

<MOVY>

0101

0110

0111

#BC

Count

#BC

Move ±# units (dots/bytes), default is dots

Move 0 to 15 units

Move # units

Class

3

Graphics commands

Command

<XFER>

High nibble

Low nibble

Description

0010 Count Transfer 1–15 bytes of graphics data

3

3

<XFER>

<COLR>

0011 #BC Transfer # bytes of graphics data

1000 Color C,M,Y,K = 2, 1, 4, 0

Note:

When the color setting is changed with the <COLR> command, the print head moves to the left-most position (x = 0).

See Example 3 and the following feature comparison table for further information.

EPSON ESC/P Printer Feature Comparison Table

Stylus LQ-150 LQ-570+

Serial Printer

Technology

COLOR

112 nozzle ink jet

(AP-3260)

24-pin impact

(AP-5000+)

24-pin impact

Multipoint Fonts

Compressed Raster

Graphics

4

Color Yes

MicroWeave

Max. Resolution (dpi)

Color/Mono

Yes

720

×

720/

720

×

720

Top/Bottom Margins 3/13 mm

4

TIFF, RLE RLE

Yes

No

360

×

180/

360

×

360

5.3/9 mm

4

RLE

No

No

N/A/360

×

360

5.3/9 mm

LQ-860/

LQ-2550

24-pin impact

0

None

Stylus 300/

800/1000

24-nozzle ink jet

4

RLE

Yes No

No

360

×

180/

360

×

360

No

N/A/

360

×

360

8.5/13.5 mm 3/13 mm

Note:

Color printing is not available with the LQ-570+ (AP-5000+), Stylus 300, Stylus

400, Stylus 800, Stylus 800+, and Stylus 1000.

Extended ESC/P 2 Programming Guide R-103

Programming examples

This section provides several programming examples that take advantage of the new features of the Stylus COLOR and later printer models. The following examples are not inclusive. Therefore, the specific driver commands you use will depend on the application.

Example 1: ESC/P 2 color multipoint font driver

Step 1 Start Job

ESC @ initialize the printer, reset printer to defaults

Step 2 Set Specific Configuration

ESC ( U

ESC ( t

ESC ( C

ESC ( c

ESC X set units assign character table set page length in defined unit—continuous paper only set page format—top and bottom margins set pitch before setting left and right margins (ESC P, ESC M,

ESC g)

ESC l & ESC Q set left and right margins

ESC = set line spacing n/360”

Step 3 Adjust Vertical Print Position (if necessary)

ESC ( V

ESC ( v

LF

FF absolute position in units relative position in units line feed form feed

Step 4 Adjust Horizontal Print Position (if necessary)

ESC $

ESC \

CR absolute position in units relative position in units carriage return

Step 5 Output Text

ESC r n select printing color where n = 0 Black

1 Magenta

2 Cyan

3 Violet

4 Yellow

5 Red

6 Green

R-104 Extended ESC/P 2 Programming Guide

ESC t

ESC X

ESC k select character table select font by pitch and point—multipoint mode select typeface (see ESC k command description for latest font parameters)

ESC 4 & ESC 5 italic on/off

ESC E & ESC F bold on/off

ESC ( select line/score

ESC q character style—outline/shadow

Send data to be printed

Repeat as necessary within line

Signal end of line—use CR, LF, or vertical positioning

Step 6 Repeat Above as Necessary within Page

Step 7 End Page

Send FF command

Prompt user for paper if in single-sheet mode

Step 8 End Job

ESC @ reset printer to defaults

Example 2: MicroWeave ESC/P 2 standard color raster graphics and RLE compressed raster graphics driver

Step 1 Start Job

ESC @ initialize the printer, reset printer to defaults

Step 2 Enter Raster Graphics Mode

ESC ( G select graphics mode

Note:

• The appropriate driver commands depend on the application.

• New or expanded ESC/P 2 commands are shown in bold.

Step 3 Set Specific Configuration

ESC ( i 01 00 n turn MicroWeave on/off where n = 0 MicroWeave off

1 MicroWeave on

Note:

• If the EPSON ESC/P 2 printer does not support MicroWeave, it will ignore the ESC ( i command. High-resolution color printers, including the Stylus

COLOR, support MicroWeave.

• Execute the ESC ( i command prior to paper feed.

Extended ESC/P 2 Programming Guide R-105

ESC ( U

ESC ( C

ESC ( c

ESC U set units set page length in defined unit—continuous paper only set page format—top and bottom margins turn unidirectional mode on/off

Adjust Vertical Print Position (if necessary)

ESC ( V

ESC ( v

LF

FF absolute position in units relative position in units line feed form feed

Step 4 Adjust Horizontal Print Position (if necessary)

ESC $

ESC \

CR absolute position in units relative position in units carriage return

Step 5 Output Raster Graphics

ESC \

ESC r n

ESC .c

relative horizontal position in units select printing color where n = 0 Black

1 Magenta

2 Cyan

4 Yellow print raster graphics data where c = 0 uncompressed raster graphics

1 compressed raster graphics (RLE)

Note:

Use data compression whenever possible to reduce file size and printing time.

CR carriage return

Repeat steps as necessary within a graphics block—start with yellow and then follow command sequence with magenta, cyan, and black. If necessary, signal the end of the graphics band with a CR, LF, or vertical positioning command.

Step 6 Repeat Above as Necessary within Page

Send FF command

Prompt user for paper if in single-sheet mode

Step 7 End Job

ESC @ reset printer to defaults (exit raster graphics mode)

R-106 Extended ESC/P 2 Programming Guide

Example 3: MicroWeave ESC/P 2 extended color raster graphics and TIFF compressed raster graphics driver

Step 1 Start Job

Send ESC @ to initialize the printer, reset printer to defaults

Step 2 Enter Raster Graphics Mode

Send ESC ( G to select graphics mode

Note:

• The appropriate driver commands depend on the application.

• New or expanded ESC/P 2 commands are shown in bold.

Step 3 Set Specific Configuration

Send ESC ( i 01 00 n to turn MicroWeave on/off where n = 0 MicroWeave off

1 MicroWeave on

Note:

• If the EPSON ESC/P 2 printer does not support MicroWeave, it will ignore the command. The Stylus COLOR supports MicroWeave.

• Execute the ESC ( i command prior to paper feed.

Send:

ESC ( U

ESC ( C

ESC ( c

ESC U to set units to set page length in defined unit—continuous paper only to set page format—top and bottom margins to turn unidirectional mode on/off

Step 4 Enter TIFF Raster Graphics Mode

Send ESC . 2 to enter TIFF compressed raster graphics mode

Note:

Only binary commands can be used after entering TIFF compressed mode.

Send <MOVXDOT> or <MOVXBYTE> to set horizontal move units to one dot or eight dots (1 byte)

Send <MOVY> to move vertically to first line of the image block

Send <COLR> to select color (Black, Magenta, Cyan, or Yellow)

Send <MOVX> or <CR> to move horizontally to first part of image block

Send <XFER> to send TIFF raster graphics data

Repeat as necessary for the existing line of the image block.

Repeat as necessary for the existing image block

Extended ESC/P 2 Programming Guide R-107

Step 5 Repeat Above as Necessary within Page

Step 6 End Page

Send <EXIT> to exit TIFF compressed raster graphics mode

Send FF command—eject paper

Prompt user for paper if in single-sheet mode

Step 7 Repeat Above as Necessary for the Job

Step 8 End Job

Send ESC @ to reset printer to defaults (exit raster graphics mode)

TIFF mode programming sequence

R-108 Extended ESC/P 2 Programming Guide

advertisement

Key Features

  • 300 cps
  • 49 dB
  • Buffer size: 64 KB
  • 12 million characters

Related manuals

Download PDF

advertisement