Welcome to my Website!
FAQ        Схемы       

 

Назад    Оглавление    Вперед

------------------------------------------------------------------------

Приложение 5: Коды команд Canon LBP.

Customer Support Program Info Systems Division

LBP ESCAPE CODES DECIMAL FORMAT

INITIALIZATION (ISO) 27 59

DIABLO 27 58

HARD RESET 27 99

SOFT RESET 27 60

UNDERLINE ON 27 91 52 109

DOUBLE UNDERLINE 27 91 50 49 109

BOLD ON 27 91 49 109

ITALIC ON 27 91 51 109

INVERSE 27 91 55 109

SHADED 27 91 53 109

TO SHUT ALL OFF 27 91 48 109

PAGE EJECT 12

10 CPI 27 40 37 36 50 27 91 48 32 75 27 91 51 121

12 CPI (NEED BM3 FONT CARD) 27 91 49 32 75 27 91 50 121

15 CPI 27 40 37 36 50 27 91 50 32 75 27 91 51 121

17 CPI 27 40 39 36 50 27 91 63 49 54 54 54 32 75

6 LPI 27 91 48 32 76

4 LPI 27 91 49 32 76

3 LPI 27 91 50 32 76

12 LPI 27 91 51 32 76

8 LPI 27 91 52 32 76

SUBSCRIPT ON 27 91 50 32 75 139

SUBSCRIPT OFF 27 91 48 32 75 140

SUPERSCRIPT ON 27 91 50 32 75 140

SUPERSCRIPT OFF 27 91 48 32 75 139

LINE DRAWING FONT 27 40 39 36 50 27 41 39 32 50

PORTRAIT 27 91 48 37 114

LANDSCAPE 27 91 49 37 114

LEGAL PAPER 27 91 51 50 112

LETTER PAPER 27 91 51 48 112

ENVELOPE TRAY 27 91 55 32 73 27 91 56 49 59 50 52 48 48

59 49 50 48 48 59 112 "Line 11 Pos 31"

WIDE CHARS 27 91 49 48 48 59 50 48 48 32 66

TALL CHARS 27 91 50 48 48 59 49 48 48 32 66

BOTH 27 91 50 48 48 59 50 48 48 32 66

TO SHUT OFF 27 91 49 48 48 59 49 48 48 32 66

10 CPI "HMI" 27 91 59 54 48 32 71

12 CPI "HMI" 27 91 59 55 50 32 71

UPRIGHT CHARACTER 27 91 50 50 109

MEDIUM CHARACTER 27 91 50 51 109

MANUAL FEED ON 27 91 49 113 (LBP-4 Multipurpose tray)

CASSETTE ON 27 91 48 113 (LBP-4 Optional cassette)

TOP BIN (DEFAULT) 27 91 51 113 (LBP 8III T/R)

BOTTOM BIN 27 91 50 113 (LBP 8III T/R)

OPT FEEDER 27 91 52 113 (LBP 8III T/R)

TWO SIDED PRINTING 27 91 49 35 120 (LBP 8III R)

SINGLE SIDED 27 91 48 35 120 (LBP 8III R)

OUTLINE 27 91 63 55 109

OUTLINE OFF 27 91 63 50 55 109

SHADOW 27 91 63 54 109

SHADOW OFF 27 91 63 50 54 109

Customer Support Program Info Systems Division

LBP ESCAPE CODES ASCII FORMAT

INITIALIZATION (ISO) ESC;

DIABLO ESC:

HARD RESET ESCc

SOFT RESET ESC<

UNDERLINE ON ESC[4m

DOUBLE UNDERLINE ESC[21m

BOLD ON ESC[1m

ITALIC ON ESC[3m

INVERSE ESC[7m

SHADED ESC[5m

TO SHUT ALL OFF ESC[0m

PAGE EJECT FF

10 CPI ESC(%$2 ESC[0 K ESC[3y

12 CPI (NEED BM3 FONT CARD) ESC[1 K ESC[2y

15 CPI ESC(%$2 ESC[2 K ESC[3y

17 CPI ESC('$2 ESC[1666 K

6 LPI ESC[0 L

4 LPI ESC[1 L

3 LPI ESC[2 L

12 LPI ESC[3 L

8 LPI ESC[4 L

SUBSCRIPT ON ESC[2 K

SUBSCRIPT OFF ESC[0 K

SUPERSCRIPT ON ESC[2 K

SUPERSCRIPT OFF ESC[0 K

LINE DRAWING FONT ESC('$2 ESC)' 2

PORTRAIT ESC[0%r

LANDSCAPE ESC[1%r

LEGAL PAPER ESC[32p

LETTER PAPER ESC[30p

ENVELOPE TRAY ESC[7 I ESC[81;2400;1200;p "Line 11 Pos 31"

WIDE CHARS ESC[100;200 B

TALL CHARS ESC[200;100 B

BOTH ESC[200;200 B

TO SHUT OFF ESC[100;100 B

10 CPI "HMI" ESC[;60 G

12 CPI "HMI" ESC[;72 G

UPRIGHT CHARACTER ESC[22m

MEDIUM CHARACTER ESC[23m

MANUAL FEED ON ESC[1q (LBP-4 Multipurpose tray)

CASSETTE ON ESC[0q (LBP-4 Optional cassette)

TOP BIN (DEFAULT) ESC[3q (LBP 8III T/R)

BOTTOM BIN ESC[2q (LBP 8III T/R)

OPT FEEDER ESC[4q (LBP 8III T/R)

TWO SIDED PRINTING ESC[1#x (LBP 8III R)

SINGLE SIDED ESC[0#x (LBP 8III R)

OUTLINE ESC [7m

OUTLINE OFF ESC [27m

SHADOW ESC [6m

SHADOW OFF ESC [26m

Customer Support Program Info Systems Division

LBP ESCAPE CODES HEX FORMAT

INITIALIZATION (ISO) 1B 3B

DIABLO 1B 3A

HARD RESET 1B 63

SOFT RESET 1B 3C

UNDERLINE ON 1B 5B 34 6D

DOUBLE UNDERLINE 1B 5B 32 31 6D

BOLD ON 1B 5B 31 6D

ITALIC ON 1B 5B 33 6D

INVERSE 1B 5B 37 6D

SHADED 1B 5B 35 6D

TO SHUT ALL OFF 1B 5B 30 6D

PAGE EJECT 0C

10 CPI 1B 28 25 24 32 1B 5B 30 20 4B

12 CPI (NEED BM3 FONT CARD) 1B 5B 31 20 4B 1B 5B 32 4B

15 CPI 1B 28 25 24 32 1B 5B 32 20 4B

17 CPI 1B 28 27 24 32 1B 5B 3F 31 36 36 36 20 4B

6 LPI 1B 5B 30 20 4C

4 LPI 1B 5B 31 20 4C

3 LPI 1B 5B 32 20 4C

12 LPI 1B 5B 33 20 4C

8 LPI 1B 5B 34 20 4C

SUBSCRIPT ON 1B 5B 32 20 4B 8B

SUBSCRIPT OFF 1B 5B 30 20 4B 8C

SUPERSCRIPT ON 1B 5B 32 20 4B 8C

SUPERSCRIPT OFF 1B 5B 30 20 4B 8B

LINE DRAWING FONT 1B 28 27 24 32 1B 29 27 20 32

PORTRAIT 1B 5B 30 25 72

LANDSCAPE 1B 5B 31 25 72

LETTER PAPER 1B 5B 33 30 70

LEGAL PAPER 1B 5B 33 32 70

ENVELOPE TRAY 1B 5B 37 20 49 1B 5B 38 31 3B 32 37 30 30 3B

31 32 30 30 3B 70 "Line 11 Pos 31"

WIDE CHARS 1B 5B 31 30 30 3B 32 30 30 20 42

TALL CHARS 1B 5B 32 30 30 3B 31 30 30 20 42

BOTH 1B 5B 32 30 30 3B 32 30 30 20 42

TO SHUT OFF 1B 5B 31 30 30 3B 31 30 30 20 42

10 CPI "HMI" 1B 5B 3B 36 30 20 47

12 CPI "HMI" 1B 5B 3B 37 32 20 47

UPRIGHT CHARACTER 1B 5B 32 32 6D

MEDIUM CHARACTER 1B 5B 32 33 6D

MANUAL FEED ON 1B 5B 31 71 (LBP-4 Multipurpose tray)

CASSETTE ON 1B 5B 30 71 (LBP-4 Optional cassette)

TOP BIN (DEFAULT) 1B 5B 33 71 (LBP 8III T/R)

BOTTOM BIN 1B 5B 32 71 (LBP 8III T/R)

OPT FEEDER 1B 5B 34 71 (LBP 8III T/R)

TWO SIDED PRINTING 1B 5B 31 23 78 (LBP 8III R)

SINGLE SIDED 1B 5B 30 23 78 (LBP 8III R)

OUTLINE 1B 5B 3F 37 6D

OUTLINE OFF 1B 5B 3F 32 37 6D

SHADOW 1B 5B 3F 36 6D

SHADOW OFF 1B 5B 3F 32 36 6D

BITMAPPED FONT SELECTION

When choosing a bitmapped font there are a few factors that have to be

taken into consideration:

ORIENTATION PORTRAIT/LANDSCAPE

GRAPHIC SET DEFAULT 96P USA

POINT SIZE SIZE OF CHARACTER

PITCH SPACING BETWEEN CHAR

STYLE UPRIGHT/ITALIC

STROKE LIGHT/MEDIUM/BOLD

TYPEFACE COURIER/PICA/ELITE......

SELECTION OF A SCALABLE FONT

Scalable font selection is just about the same as a Bitmaped font

Selection. You can select a scalable font by 1 (ATTRIBUTE) or by 2

(TYPEFACE NAME), just to name a few. The main difference between a

scalable font selection and bitmap font selection is:

1) To keep compatibility with the LBP-8II series of printers that did not

have Scalable font technology, a scalable font has to be enabled

(ESC[?32h). If printing in landscape Rotation also has to enabled

(ESC[?33h).

2) When using a scalable font, a specific point size must be selected. In

the LBP-8II point size selection was the actual point size x 100.

Example: 12pt dutch would be ESC [120 C. For the LBP-8III/4 printers

the point size is derived from type size unit factor, 1/720, 1/300.

Example: if 1/300 was the size unit a 12pt font would be ESC [60 C.

SCALABLE FONT SELECTION BY ATTRIBUTE:

====================================

Basic Programming example:

10 LPRINT CHR$(27) + ";"; 'Begin ISO mode

20 LPRINT CHR$(27) + "[7 I"; 'size unit 1/300

30 LPRINT CHR$(27) + "[11h"; 'enable horiz movement

40 LPRINT CHR$(27) + "[?32h"; 'enable scaling

50 LPRINT CHR$(27) + "(B"; 'ISO_USA as graphic set

60 LPRINT CHR$(27) + "[?0 K"; 'select proportional spacing

70 LPRINT CHR$(27) + "[60 C"; 'pt size

80 LPRINT CHR$(27) + "[22;23m"; 'upright and medium character

90 LPRINT CHR$(27) + "[5;10y"; 'Dutch typeface

This program selects Dutch 12pt, All of these commands do not

Have to necessarily be sent lines 10..40 should usually only get

sent once. Lines 50..90 actually creates the font.

Basic Programming example: Symbol fonts

10 LPRINT CHR$(27) + ";"; 'ISO mode

20 LPRINT CHR$(27) + "[11h"; 'horiz movement

30 LPRINT CHR$(27) + "[7 I"; '1/300 size unit

40 LPRINT CHR$(27) + "[?32h"; 'Enable Scaling

50 LPRINT CHR$(27);CHR$(40);CHR$(34); + "!!0"; 'GR SET SYML

60 LPRINT CHR$(27);CHR$(41);CHR$(34); + "!!1"; 'GR SET SYMR

70 LPRINT CHR$(27) + "[?0 K"; 'Selects proportional pitch

80 LPRINT CHR$(27) + "[100 C"; '20 pt font

90 LPRINT CHR$(27) + "[137;10y"; 'Symbol Typeface

The important part of this program is lines 50, 60, 90. Line 50 Selects

SYML as the primary graphic set. Line 60 selects SYMR as the secondary

graphic set. Line 90 selects the Symbol typeface

 

SCALABLE FONT CELEBRATION BY NAME:

=================================

When selecting a Scalable font by name we must specify the typeface name

plus the point size desired. Here is an example:

10 LPRINT CHR$(27) + ";"; 'ISO mode

20 LPRINT CHR$(27) + "[7 I"; '1/300

30 LPRINT CHR$(27) + "[11h"; 'Enable Horiz movement

40 LPRINT CHR$(27) + "[?32h"; 'Enable Scaling

50 LPRINT CHR$(27) + "PzDutch-Roman.ISO_USA"+CHR$(27);CHR$(92);

60 LPRINT CHR$(27) + "[100 C";

Typeface Selection by name eliminates the need to end the proportional

space command, Upright, or medium commands. Pt size is dependent on the

size unit being used. 1/300 makes this font approximately 20pt.

Remember scaling has to be enabled and a point size must be specified

after every call for a typeface. If no definite point size is called then

the point size defaults to 1 pt.

 

 

The command that allows for horizontal & vertical spacing and movement to

change is the

Size unit mode or the Escape sequence ESC [11h.

This commands tells the controler to use a specified size unit, either

1/720 of an inch or 1/300 of an inch, or 1/300 mm. When you create

a scalable font from a font master or outline, you have to use 1 of the

above fractions to create the font height.

you have to change the vertical lines spacing if you create a character

larger than 10pt or a character that does not fit in the default 6

lines per inch.

The Escape sequence that controls horizontal and vertical spacing is

ESC [V;HspG

V = vertical unit

H = Horizontal unit

sp = a space

G = Terminator

This command is affected by the fraction you are using. Seeing you are

using a poportional space you do not need to change the H value.

Typically in typsetting you have a 2pt more to a line so a 12pt character

would have a 14pt line spacing.

point size is calculated as

pt/72 1/300

pt = the point size desired

72 = their are 72 points to an inch

1/300 is the fraction we are currently using.

if pt equaled 14 then the calculation would be:

14*300 = 4200 / 72 = 58.333 (this number can be rounded of to 60)

place 60 in the V position as follows.

ESC [60;spG

ESC = 27 in decimal

[ = 91

60 = the vertical unit and equals 54 48 in decimal

; = 59 in decimal

sp = a space and 32 in decimal

G = 71 in decimal

 

Question: If I have created a font and then want to change do I have to

send the whole priority order again?

Yes and no you would have to know what the fonts was previously so if

you have to shut off an attribute that is already selected.

For example:

if you have a Dutch 12pt and want to select dutch 12 pt bold than all you

have to do is send the escape sequence for bold.

know that you have dutch 12pt bold and want dutch and want dutch italic

than you have to shut off bold and turn on italics.

Basically what most printer drivers do. Is if you select a specific font

ie Dutch 12pt Bold, or Swiss 14pt, they send all the information to select

that specific font in the case of dutch 12pt bold (you would shut off

italics, underline and so forth). in the case of Swiss 14pt you would shut

off bold italics and underline.

If your software has an option for a specific attribute on and off than

the user takes the responsibility of knowing what font is selected before

they select a specific attribute.

SETTING MARGINS IN CAPSL III

There are four commands dedicated for margin control:

ESC[0t = sets left margin

ESC[1t = sets right margin

ESC[2t = sets top margin

ESC[3t = sets bottom margin

All of these commands set the respective margin at the current

position. There are several ways to change the current position.

1. Sending spaces to the printer (decimal number 32) will move the

internal pointer horizontally into a new position. Sending line feeds

to the printer (decimal number 10) will move the internal pointer to a

different vertical position. After moving the internal pointer to the

correct position you should sent the appropriate margin command.

2. Changing the current position can also be achieved by movement

commands relative to the current position. These commands are:

ESC[#e = move down

ESC[#k = move up

ESC[#j = move left

ESC[#a = move right

The # represents the number of lines or spaces to move.

EXAMPLE: If we wanted to move the left margin in 20 spaces from the

current position. The code would be = ESC [20a ESC [0t

10 lprint chr$(27) + "[20a";

20 lprint chr$(27) + "[0t"

3. The current position can also be moved by using the absolute movement

command. This command uses a coordinate system, starting at the top

left corner of the page. There are three commands:

ESC[V;Hf = move absolute

ESC[#` = move horizontal

ESC[#d = move vertical

The # represents the amount of movement necessary. The V represents

the amount of vertical movement and the H represents the amount of

horizontal movement necessary. The move absolute commands need the

amount of movement as well as a size unit value. The default size unit

value is 1/720.

EXAMPLE: If we wanted to have a 1 inch top and left margin. The code

would be = ESC[720;720f ESC[0;2t A right margin of 1 inch

would be = ESC[;5400 ESC[1t

10 lprint chr$(27) + "<"; soft reset

20 lprint chr$(27) + ";"; ISO mode

30 lprint chr$(27) + "[0;1u"; clears margins

40 lprint chr$(27) + "[720;720f"; move 1 inch Vertical & Horizontal

50 lprint chr$(27) + "[0;2t"; set top and left margin

60 lprint chr$(27) + "[;5400f"; move to the right 7.5 inches

70 lprint chr$(27) + "[1t"; set right margin

Overlays Printing for the LBP-8III/4

The Canon LBP-8III and the Canon LBP-4 offer a very useful built-in

feature called Overlays. An Overlay is an image (object) such as a logo

or letterhead which is defined and downloaded to the printer's memory.

Once the Overlay has been defined and downloaded, it can be used over and

over again - turned on and turned off by simply placing the proper

escape sequence in your document. An Overlay can be your name and

address for a letterhead, a specific form that you need to be printed,

your logo or any other text or graphics you create. With the Canon LBP's

you can save up to two Overlay in the printers memory, saving you time

and effort.

At the command line you will now enter the proper escape sequence,

which will mark where to "Begin Overlay Registration." Important

Note: Enter the escape sequence exactly as it appears, noting lower

or upper case letters. No spaces are placed between codes.

Type: <27>[1;0;1&s

Enter in the information that you want in the Overlay.

the Overlay registration using the "End Overlay Registration" escape

type; <27>[0&s

<27>[1;0&w This is the escape code to turn the Overlay On.

To turn the "Overlay Off", repeat steps 1 through 5, then at

the command line - Type; <27>[0;0&w.

Important Note: Since the printers memory can store two overlays, the

escape sequence for the overlays are slightly different. To use the

second overlay, enter the following escape sequences in place of the

Overlay 1 sequences.

To Begin Overlay Registration enter the escape sequence <27>[1;1;1&s

To End Overlay Registration, enter the escape sequence <27>[0&s

To turn On Overlay 2 enter the escape sequence <27>[1;1&w

To turn Off Overlay 2, enter the escape sequence <27>[0;1&w

Variable line spacing can be accomplished on CaPSL printers (LBP 8 series,

LBP-4) with the use of Set Movement Indicies command.

ESC [(verical #);(Horizontal #)sp G

(vertical #) & (horizontal #) are derived from a fraction. The values the

CaPSL printers allow for are 1/720 (default) 1/300 1/1000mm 1/100mm. These

values are accomplished with the Select Size Unit Command.

ESC [(#)sp I

# = 2 (1/720 Inch)

# = 6 (1/1000 mm)

# = 7 (1/300 Inch)

` # = ?6 (1/100mm)

To set 66 lines per page the vertical number would be 113 (1/720) or

47 (1/300). The Escape Sequence would look like this.

ESC [7spI

ESC [113;spG

sp represents a space

In decimal 27 91 55 32 73

27 91 49 49 51 59 32 71

To set 12 characters per inch the horizontal number would change to

60 (1/720) 25 (1/300). The Escape Sequence would look like this.

ESC [7spI

ESC [;60spG

sp represents a space

In decimal 27 91 55 32 73

27 91 59 54 48 32 71

To set it back to 10 characters per inch the horizontal number would be

change to 72 (1/720) 30 (1/300). The Escape Sequence would look like this.

ESC [7spI

ESC [;72spG

sp represents a space

In decimal 27 91 55 32 73

27 91 59 55 50 32 71

 

Назад    Оглавление    Вперёд

 

servi2000@narod.ru