Solved

printers

Posted on 1998-09-15
7
306 Views
Last Modified: 2008-03-06
list of escape codes for laser print
0
Comment
Question by:lapettina
7 Comments
 
LVL 12

Expert Comment

by:mark2150
ID: 1010547
Most all of the laser printers obey the hp LaserJet II command set. If you use these commands 99% of the lasers in the world will work.

There are a *LOT* of laser commands in the PCL command set. Are there any SPECIFIC codes you want?

I have a complete set of codes for everything from simple line drawing and text positioning to bitmapped graphics and font downloading. It is *MUCH TOO MUCH* to post here.

Contact me at mark_lambert@ntsc.navy.mil for more details
0
 

Author Comment

by:lapettina
ID: 1010548
la impresora es una HP LASERJET 4L
y necesito definirle tamaño de hoja, tamaños de caracteres, y otros codigos de escape.
Si ponen una version en español para las preguntas y respuestas seria maravilloso!!!

0
 
LVL 12

Expert Comment

by:mark2150
ID: 1010549
Mi palabra espanol poquito. Cinco anos en Miami.

De programma es in mi officina. (my spanish just ran out...) I'll send it to you monday.

Adios!

M
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Expert Comment

by:ewilson
ID: 1010550
HP is usually very good about providing the PCL command set with all of their printers if you do not have the books that came with the printer then check thier website maybe you can download or order it.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1010551
;
; These are the standard laser control strings
;
;                  Reset     10 CPI       6 LPI        Portrait
P_RESET      DB      ESK, "E", ESK, "&k0S", ESK, "&l6D", esk, "&l0O", ZERO
;
;                          300 DPI     Begin raster
PREAMBLE      DB      ESK, "*t300R", ESK, "*r1A", ZERO
;
P_RESET1      DB      ESK, "E", zero
;
            EVEN
;                  'n' bytes follow
PCX_SETUP      DB      ESK, "*r1A"            ;Start at current cursor
            DB      ESK, "*t300R", zero      ;300 DPI
;
PCX_HD            DB      ESK, "*b"            ;Begin graphics row
PCX_LEN      DB      "0000W", zero
;
PCX_TAIL      DB      ESK, "*rB", ESK, "&f1S", zero      ;End of graphics & restore
;
;                  'n' bytes follow
X1_HD            DB      ESK, "*b32W"
X1_BODY      DB      32 DUP (ZERO)
X1_LEN            EQU      $ - X1_HD
;
PCX_BODY      DB      32 DUP (ZERO)      ;Here we store our line of GFX
;
X4_HD            DB      ESK, "*b128W"
X4_BODY      DB      128 DUP (ZERO)
X4_LEN            EQU      $ - X4_HD
;
X8_HD            DB      ESK, "*b256W"
X8_BODY      DB      256 DUP (ZERO)
X8_LEN            EQU      $ - X8_HD
;
;                  Raster ends
POSTAMBLE      DB      ESK, "*rB", ZERO
;
; These are the LaserJet command strings
;
BAR            DB      ESK, "*c4a150B"            ;Bar is .015w x .5h
            DB      ESK, "*c0P", zero      ;Lase command
;
NO_BAR            DB      ESK, "*p+4x+0Y", zero      ;Move right .015
;
PTR_PUSH      DB      ESK, "&f0S", zero      ;Save current cursor
;
PTR_POP      DB      ESK, "&f1S", zero      ;Restore cursor
;
MOVE_TO_RC      DB      ESK, "*p"            ;Move to specified row & col
SET_COL      DB      "0000x"                  ;Col dot could be 2556
SET_ROW      DB      "0000Y", zero            ;Row dot could be 3300
;
SET_PORT      DB      ESK, "&l0O", zero
SET_LAND      DB      ESK, "&l1O", zero
;
; move.delta.xy$ = esk, "*p+", x$, "x+", y$, "Y"
;
REL_MOVE      DB      ESK, "*p-"
REL_MOVEX      DB      "0000X", ZERO
            .XLIST
;
; Templates for laser command
;
; esk, "*p", x$, "x", y$, "Y", esk, "*c3a3b100g0P"
; set.gray$ = esk, "*c", g$, "G"
; move.xy$ = esk, "*p", STR$(ABS(h.inches * dots - 1)), "x", STR$(ABS(v.inches * dots - 1)), "Y"
; move.delta.xy$ = esk, "*p+", x$, "x+", y$, "Y"
; move.col.row$ = esk, "&a", col$, "c", row$, "R"
; draw.bar$ = esk, "*c", x$, "a", y$, "B"
; hack$ = push.pos$, move.delta.xy$(0, -half.line), draw.bar$(margin / 2, .001), prt.bar$, pop.pos$
; reset$ = esk, "E"
; push.pos$ = esk, "&f0S"
; pop.pos$ = esk, "&f1S"
; prt.bar$ = esk, "*c0P"
; prt.gray$ = esk, "*c2P"
; prt.pat$ = esk, "*c3P"
;
            .XLIST
;
SPACE_DOWN      DB      esk, "*p+"            ;Position Relative
SPACING      DB      "0050Y", ZERO            ;6 LPI - match to VE "ONE_ROW"
;
FORM_XY      DB      esk, "*p+"            ;Position Relative
FORM_X            DB      "0000x+"
FORM_Y            DB      "0000Y", ZERO
;
FORM_ABS_XY      DB      ESK, "*p"            ;Position Absolute
FORM_ABS_X      DB      "0000x"
FORM_ABS_Y      DB      "0000Y", ZERO
;
FORM_WH      DB      ESK, "&f0S"            ;Save current
            DB      ESK, "*c"            ;Begin line
FORM_LINE_W      DB      "0000a"                  ;Width
FORM_LINE_H      DB      "0000b"                  ;Height
LASE_GRAY      DB      "100g"                  ;Gray Intensity
AS_A_RULE      DB      "0P"                  ;Rule/gray switch
            DB      ESK, "&f1S", ZERO      ;Restore
;
SET_COPY_HEAD      DB      ESK, "&l"            ;Set copy count
SET_COPIES      DB      "01X", zero
;
FONT_HEAD      DB      ESK, "*c"            ;Start font load
FONT_NUM      DB      "0000D", ZERO            ;Insert font number here
                                    ;and copy font file to printer
;
PICK_FONT      DB      ESK, "("            ;Select primary Font
FONT_NUMBER      DB      "0000X", ZERO            ;Insert number here
;
NORMAL_FONT      DB      ESK, "&k2S"            ;16.6 CPI
            DB      ESK, "&l8D"            ;8 LPI
            DB      ESK, "(11U"            ;IBM PC character set
            DB      ESK, "(s0t8.5v0P"      ;Line printer, 8.5pt, fixed
            DB      ZERO
;
COURIER_FONT      DB      ESK, "&k0S"            ;10 CPI
;            DB      ESK, "&l6D"            ;6 LPI - Allow override on spacing
            DB      ESK, "(10U"            ;IBM PC character set
            DB      ESK, "(s3t0p0B"            ;Courier, fixed, normal
;            DB      ESK, "(s3t12v0p0B"      ;Courier, 12 pt, fixed, normal
            DB      ZERO
;
; Ok, flowchart for drawing a box is as follows:
;
; Save
; Line Wide, Thick            L1
; Line Thick, High            L2
; Move (Wide - Thick), 0      M1
; Line Thick, High            L3
; Restore
; Save
; Move 0, (High - Thick)      M2
; Line Wide, Thick            L4
; Restore
;
BOXER            DB      ESK, "&f0S"            ;Save current
;
; Line #1
;
            DB      ESK, "*c"            ;Begin line
L1W            DB      "0000a"                  ;Width
L1H            DB      "0000b"                  ;Height
            DB      "100g"                  ;Gray Intensity
            DB      "0P"                  ;Rule/gray switch
;
; Line #2
;
            DB      ESK, "*c"            ;Begin line
L2W            DB      "0000a"                  ;Width
L2H            DB      "0000b"                  ;Height
            DB      "100g"                  ;Gray Intensity
            DB      "0P"                  ;Rule/gray switch
;
; Move #1
;
            DB      esk, "*p+"            ;Position Relative
M1X            DB      "0000X"
;
; Line #3
;
            DB      ESK, "*c"            ;Begin line
L3W            DB      "0000a"                  ;Width
L3H            DB      "0000b"                  ;Height
            DB      "100g"                  ;Gray Intensity
            DB      "0P"                  ;Rule/gray switch
;
            DB      ESK, "&f1S"            ;Restore
            DB      ESK, "&f0S"            ;Save current
;
; Move #2
;
            DB      esk, "*p+"            ;Position Relative
M2Y            DB      "0000Y"
;
; Line #4
;
            DB      ESK, "*c"            ;Begin line
L4W            DB      "0000a"                  ;Width
L4H            DB      "0000b"                  ;Height
            DB      "100g"                  ;Gray Intensity
            DB      "0P"                  ;Rule/gray switch
;
            DB      ESK, "&f1S"            ;Restore
            DB      ZERO                  ;End
;

0
 
LVL 12

Expert Comment

by:mark2150
ID: 1010552
I know this is a little hard to read, but 95% of the operations that you'ld want to do with a laser are defined here. The ESK is an ASCII ESC (1BH/27D). The codes here work when sent to the laser. What else are you looking for?

M

0
 
LVL 2

Accepted Solution

by:
jamestthomas earned 50 total points
ID: 1010553
HP LaserJet 4L Printer - PCL Typeface List with Escape Sequences





Internal SCALEABLE Typefaces and Bit mapped Fonts


TYPEFACE
 PITCH / POINT
 ESCAPE SEQUENCE
 
Courier
 Scale
 <esc>(___<esc>(s0p *** h0s0b4099T
 
CG Times
 Scale
 <esc>(___<esc>(s1p - - - v0s0b4101T
 
CG Times Bold
 Scale
 <esc>(___<esc>(s1p - - - v0s3b4101T
 
CG Times Italic
 Scale
 <esc>(___<esc>(s1p - - - v1s0b4101T
 
CG Times Bold
     
Italic
 Scale
 <esc>(___<esc>(s1p - - - v1s3b4101T
 
Coronet
 Scale
 <esc>(___<esc>(s1p - - - v1s0b4116T
 
Univers Medium
 Scale
 <esc>(___<esc>(s1p - - - v0s0b4148T
 
Univers Bold
 Scale
 <esc>(___<esc>(s1p - - - v0s3b4148T
 
Univers Medium
     
Italic
 Scale
 <esc>(___<esc>(s1p - - - v1s0b4148T
 
Univers Bold
     
Italic
 Scale
 <esc>(___<esc>(s1p - - - v1s3b4148T
 
Univers Medium
     
Condensed
 Scale
 <esc>(___<esc>(s1p - - - v4s0b4148T
 
Univers Bold
     
Condensed
 Scale
 <esc>(___<esc>(s1p - - - v4s3b4148T
 
Univers Medium
     
Condensed Italic
 Scale
 <esc>(___<esc>(s1p - - - v5s0b4148T
 
Univers Bold
     
Condensed Italic
 Scale
 <esc>(___<esc>(s1p - - - v5s3b4148T
 
Antique Olive
 Scale
 <esc>(___<esc>(s1p - - - v0s0b4168T
 
Antique Olive
     
Bold
 Scale
 <esc>(___<esc>(s1p - - - v0s3b4168T
 
Antique Olive
     
Italic
 Scale
 <esc>(___<esc>(s1p - - - v1s0b4168T
 
Albertus Medium
 Scale
 <esc>(___<esc>(s1p - - - v0s1b4362T
 
Albertus
     
Extra Bold
 Scale
 <esc>(___<esc>(s1p - - - v0s4b4362T
 
Wingdings
 Scale
 <esc>(579L<esc>(s1p - - -v0s0b6826T
 
Courier Bold
 Scale
 <esc>(___<esc>(s0p *** h0s3b4099T
 
Courier Italic
 Scale
 <esc>(___<esc>(s0p *** h1s0b4099T
 
Courier
     
Bold Italic
 Scale
 <esc>(___<esc>(s0p *** h1s3b4099T
 
Letter Gothic
 Scale
 <esc>(___<esc>(s0p *** h0s0b4102T
 
Letter Gothic
     
Bold
 Scale
 <esc>(___<esc>(s0p *** h0s3b4102T
 
Letter Gothic
     
Italic
 Scale
 <esc>(___<esc>(s0p *** h1s0b4102T
 



*** Pitch: .10 - 576 Symbol set



- - - Point size: .25 - 999.75



 

 
 
 

 

0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

The Rasberry PI is a low cost piece of hardware that you can have a lot of fun with through experimenting and building/working on projects like media players, running a low cost computer, build data loggers etc. - see: https://www.raspberrypi.org
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now