|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
n = 1 Select Bin 1 n = 2 Select Bin 2 n = 4 Enable CSF n = R Eject Sheet |
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
n/216-inch |
|
|
|
n/72-inch |
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
To determine the values for n1 and n2 perform the following steps. 1. Determine the desired page length in inches. 2. Multiply the page length by 360. 3. Divide the result by 256 using long division. 4. The remainder in the quotient from step 3 is the value for n1. 5. The whole number in the quotient from step 3 is the value for n2. EXAMPLE 1. The page length is 8.5 inches. 2. 8.5 x 360 = 3060 3. 3060 divided by 256 = 11 with a remainder of 244. 4. n1=244 5. n2=11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To determine the values for n1 and n2 perform the following steps. 1. Determine the desired vertical distance from the Top of Form in inches. 2. Multiply the distance by 360. 3. Divide the result by 256 using long division. 4. The remainder in the quotient from step 3 is the value for n1. 5. The whole number in the quotient from step 3 is the value for n2. EXAMPLE 1. The desired distance from the Top of Form is 1 inch. 2. 1 x 360 = 360 3. 360 divided by 256 = 1 with a remainder of 104. 4. n1=104 5. n2=1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
immediate n/180 feed |
|
|
|
reverse feed n/180 |
|
|
|||
|
|
n = 1 San Serif n = 2 Courier n = 3 Prestige n = 4 Script n = 5 Ocr-B n = 6 Ocr-A n = 7 Orator (only with mult-font module) n = 8 Orator (only with mult-font module) |
|
|
|
|
|
10 12 15 17 20 |
80 96 120 137 use 10 condensed 160 use 12 condensed |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
n = 1 Elite n = 2 Proportional n = 4 Condensed n = 8 Emphasized n = 16 Double Strike n = 32 Double Wide n = 64 Italic n = 128 Underline |
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
n2 Must be 0 m Must be 1 d1 = 1 Underscore d1 = 2 Strike-Through d1 = 3 Overscore d2 = 0 Cancel selected score d2 = 1 Single line continuous d2 = 2 Double Line continuous d2 = 5 Single Line broken d2 = 6 Double Line broken |
|
|
|
n = 1 Outline n = 2 Shadow n = 3 Outline & Shadow |
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
n = 1 centering n = 2 flush right n = 3 justified |
|
|
|
0 Italic 1 Graphic set/PC437 (US) 2 User-defined Characters (remap to 80h-FFh) 3 PC437 (US) |
|
|
|
|
|
0 Italic 1 PC437 (US) 2 User-defined Characters 3 PC437 (US) |
0 Italic 1 PC437 (US) 3 PC850 (International) 7 PC860 (Portugal) 8 PC863 (Canada - French) 9 PC865 (Norway) |
||
|
|||
|
|
n = 1 France n = 2 Germany n = 3 United Kingdom n = 4 Denmark I n = 5 Sweden n = 6 Italy n = 7 Spain n = 8 Japan n = 9 Norway n = 10 Denmark II n = 11 Spain II n = 12 Latin America n = 13 Korea n = 64 Legal |
|
|
|
|
|
|
|
|
|
|
|
> 1 = Sans Serif font > 2 = Courier |
|
|
expanding the printable character set. |
||
|
|
|
|
|
|
To determine the values for n1 and n2 perform the following steps. 1. Determine how many ASCII codes will be sent sequentially immediately following n1 and n2. 2. Using long division, divide the quantity of ASCII codes that will be sent sequentially immediately following n1 and n2 by 255. 3. The remainder in the quotient is the value for n1. 4. The whole number in the quotient is the value for n2. EXAMPLE
|
|
|
|||
|
|
m = 0 = 60 DPI m = 1 = 120 DPI m = 2 = 120 DPI Hi Spd m = 3 = 240 DPI m = 4 = 80 DPI m = 5 = 72 DPI m = 6 = 90 DPI m = 7 = 144 DPI 24-Pin Graphics: m = 32 = 60 DPI m = 33 = 120 DPI m = 38 = 90 DPI m = 39 = 180 DPI m = 40 = 360 DPI |
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
n = 1 Red (Magenta) n = 2 Blue (Cyan) n = 3 Violet n = 4 Yellow n = 5 Orange n = 6 Green |
|
|
|
|
|
|
|||
|
|
My experience with sending printer command codes is with
Paradox for DOS (a relational database). When designing a report, I create
a calculated field and enter the Esc sequence within quotes. The quotes
indicate that it's a string to be passed on, rather than a command for
Paradox. "Esc" tells the printer that all characters before the next space
are part of a printer command. It seems to be necessary to convert the
"Esc" to ASCII but optional to convert the rest of the command. The "\027"
is simply the
ASCII equivalent
of "Esc".
I've picked some examples from a report; "\027x0\015" puts my ESC600 into compressed mode (17 char. per inch) "\027w\001" turns expanded mode on (large characters) "\027w\000" turns expanded mode off (back to 10 char per inch)
blue = from the Paradox for DOS manual for LQ-1500 (dot matrix) navy = from the Epson's escp2.txt file fuchsia = from ESCODE.TXT, was pulled from the Epson bbs. purple
= from Peter Curran's MX-100 (dot matrix) manual
http://webpages.charter.net/dperr/links/esc_p2.htm |
It seems that many people find it hard to configure DOS programs such as Sage, banking programs etc. to print in a sensible format to laser printers (or line / dot matrix ones for that matter).
The following codes can be used in DOS batch files or within an application's configuration program for controlling a HP or compatible PCL printer:
Characters | ASCII codes | Effect |
[ESC] ( s 3 B |
27 40 115 51 66 | Bold On |
[ESC] ( s 0 B |
27 40 115 48 66 | Bold Off |
[ESC] & d 1 D |
27 38 100 49 68 | Single Underline On (use 3 for floating underline) |
[ESC] & d 2 D |
27 38 100 50 68 | Double Underline On (use 4 for floating underline) |
[ESC] & d 0 D or [ESC] & d @ |
27 38 100 48 68 27 38 100 64 |
Underline Off ( |
[ESC] & l 1O (el one Oh) |
27 38 108 49 79 | Landspace |
[ESC] & l 0O (el zero Oh) |
27 38 108 48 79 | Portrait |
[ESC] ( s 1 6 H |
27 40 115 49 54 72 | 16.66 cpi (132 columns in portrait, 160 landscape) |
[ESC] ( s 1 2 H |
27 40 115 49 50 72 | 12 cpi (96 columns in portrait, 136 landscape) |
[ESC] ( s 2 0 H |
27 40 115 50 48 72 | 20 cpi (160 columns in portrait, 220+ landscape) |
[ESC] & a [n] L [ESC] & a 0 L |
27 38 97 [n] [n].. 76 27 38 97 48 76 |
Left Margin [n] lines |
[ESC] & a [n] M [ESC] & a 1 3 2 M |
27 38 97 [n] [n].. 77 27 38 97 49 51 50 77 |
Right Margin [n] lines |
[ESC] & l [n] E [ESC] & l 1 E |
27 38 108 [n] [n].. 69 27 38 108 49 69 |
Top Margin [n] lines |
[ESC] & l [n] F [ESC] & l 6 6 F |
27 38 108 [n] [n].. 70 27 38 108 54 54 70 |
Bottom Margin [n] lines |
[ESC] 9 |
27 57 | Clear Margins |
[ESC] & l [n] C [ESC] & l 5 C |
27 38 108 [n] [n] 66 27 38 108 53 66 |
Line Spacing ([n]/48") |
[ESC] = |
27 61 | Half line feed |
[ESC] & l [n] D [ESC] & l 9 D |
27 38 108 [n].. 67 27 38 108 57 67 |
[n] Lines per inch |
[ESC] & l [n] P [ESC] & l 6 6 P |
27 38 108 [n] [n].. 80 27 38 108 54 54 80 |
Page length [n] lines |
[ESC] E |
27 69 | Reset printer |
In PCL each sequence of command typically starts with the Escape character, a start character, a value in text form, then ends in a capital letter. You can combine more than one command which start with the same two characters after the Escape by changing the last letter of the first part to lower case and leaving off the next start letter, eg:
[ESC] &l1O [ESC] &l1E [ESC]&l0L would become [ESC] &l1o1e0L
It is often necessary to combine the commands like this as older programs typically only allow 10 or 12 characters to be entered for each effect. To make an uppercase letter into lowercase add 32 to it's ASCII code.
eg to Put a HP Laserjet 5Si into 132 column mode with 66 lines in landscape the following should work:
[ESC] E [ESC] & l 1 o 0 e 6 6 f 9 D [ESC] & a 0 l 1 3 2 M [ESC] ( s 1 3 H
Which is Reset, Landscape, 0 Top Margin, 66 Bottom Margin, 9 Lines per Inch, 0 Left Margin, 132 Right Margin, 13 Pitch Font.
From a DOS batch file you can often send codes to a printer using ECHO commands which have been entered using EDIT. This could be to a local printer or captured to a network printer, eg:
ECHO ~E~&l1o0e66f9D~&a0l132M~(s13H > LPT1:
where ~ is the [ESC] character which in edit can be entered with Control P then Control [ and shows as an arrow pointing to the left.
Note in Windows 2000 and XP the & symbol is used to run two or more commands from the same command line therefore it is not possible to send a command exactly as above. Workarounds include adding a double quote (") character prior to the escape string, e.g. ECHO "rest of the string" but this leaves the " character printed on the paper or adding the codes to a text file using EDIT then sending the text file to the printer with a line such as:
COPY textfile.txt LPT1:
or COPY textfile.txt \\server\share
or TYPE textfile.txt > LPT1:
or PRINT textfile.txt
or NPRINT textfile.txt (for Novell systems)
I have since found that you can use a circumflex character (^) to escape the ampersand (&) to make it show as text rather than be interpreted by Windows, e.g.
ECHO ~E~^&l1o0e66f9D~^&a0l132M~(s13H > LPT1:
From a simple DOS based BASIC such as Quick Basic 4.5 (QB45) you can send codes in a number of ways. The easiest is to assign some codes to variables and use those in print # or lprint statements to the printer port. You use the chr$() function to send unprintable codes such as Escape and Form Feed or those difficult to enter such as the double quote " which is chr$(34) i.e.:
esc$=CHR$(27) boldon$=esc$+"(s3B" boldoff$=esc$+"(s0B" formfeed$=chr$(12) filenum=FREEFILE OPEN "lpt1:" FOR OUTPUT AS filenum PRINT #filenum, boldon$ + "This is in bold" + boldoff$ CLOSE #filenum LPRINT boldon$ + "This is in bold" + boldoff$
Changing Printer Display
The following code sent to a HP Printer will change the message on the display to "Any message":
[ESC]%-12345X@PJL JOB @PJL RDYMSG DISPLAY="Any message" @PJL EOJ [ESC]%-12345X
[ESC] is ascii 27, Control [. Enter in EDIT using Control P, Control [.
Since looking for a good reference for some more exotic PCL codes I hadn't previously used I found this reference which you may find handy too: http://printers.necsam.com/public/printers/pclcodes/pcl5hp.htm
Text links:
|