Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.


Envelope Manual feed

Envelope Manual feed

I just wrote a program to print mailing addresses on #10 envelopes. Among others, I used the command Esc & l 3 H to initiate the job. The results were bizzare, nothing was printed on the envelopes; when I fed instead letter paper, one line was printed on each sheet, far outside the area that would have printed on the envelopes. I switched to Esc & l 2 H, and the envelopes printed the way I wanted and expected.

So what does the "3" option do, and what is its purpose?

RE: Envelope Manual feed

Well, if you mean <esc>&l3H, then we are talking about the source tray; i.e., which physical device the printer should pull the paper from when printing. See the PCL5 Ref for some examples of devices common to different tray select commands. Let's say that an envelope feeder is normally addressed as <esc>&l3H. Now just entering the code doesn't make an envelope feeder exist.

Depending on the paper size etc., the coordinate system 0,0 may very well be in a different location depending on the tray and its expected contents. Particularly on a landscape page, 0,0 on a legal size is three inches off the end of a letter sized sheet of fed from the fold down tray.

Although, I'm somewhat suprized you aren't getting a complaint from the printer.

What model printer and what extra devices?

What printer init strings? Along with a bit of the data in as shown in the PCL file.

Jim Asman

RE: Envelope Manual feed

It is an HP LaserJet 2200D
Here is the data sent:


James Fairfield        
1234 MAIN ST.  
HOMETOWN, CA  90210 
Note that "~" represents the Esc character, which does not display properly here.
The PRINT command adds a page feed at the end.
This is the code that works. When I replace the "2" in the 6th byte with a "3", I get rhe wierd results I mentioned above.
The printer has one paper tray and the manual feed tray which I use to feed the envelopes.

RE: Envelope Manual feed

OK. The <esc>&k3H command specifies an envelope being fed through the manual feed as you are doing; however, you have not specified a paper size, and that is probably why you are getting funny results with 3H as the printer is defaulting to letter size. 81 is the page size number for a No. 10 envelope.

Try <esc>&l81a1o3h6d0e24F as the printer init and report back.

This will probably require your left margin command etc. to be revised.

Does your printer automatically center the envelope in the input tray?

Jim Asman

RE: Envelope Manual feed

Thank you for this post, I learned something and it's worth a star.

With the init i gave you, the first character on your line will be in the first character position on the left side of the envelope. Maybe change the left margin value from 40 to <esc>&a25L

I have always printed envelopes just using letter size and just working out the X,Y required to suitably position the printing on the envelope. But this is MUCH better.

Jim Asman

RE: Envelope Manual feed

I agree with Jim's diagnosis.

Just to make things a bit clearer, here are analyses of the various PCL snippets:

CODE -->

<Esc>E            Printer Reset
<Esc>&l2h         Paper Source: id 2 is Printer Dependent
       1o         Orientation: Landscape
       29E        Top Margin (29 lines)
<Esc>&a40L        Left Margin (column 40) 

CODE -->

<Esc>&l81a        Page Size: COM-10 Envelope
       1o         Orientation: Landscape
       3h         Paper Source: id 3 is Printer Dependent
       6d         Line Spacing (6 lines-per-inch)
       0e         Top Margin (0 lines)
       24F        Text Length (24 lines)
<Esc>&a25L        Left Margin (column 25) 

The only comments I'd add are:

  • With the 'set left margin by column' sequence <Esc>&a#L, the width of each column is determined by the current Horizontal Motion Index setting, as set implicitly by the current font selection, or explicitly via the <Esc>&k#H sequence.
  • Using X and Y positioning sequences, the values are relative to the current left and top margins.

RE: Envelope Manual feed

Oops - my comment about X and Y positioning is wrong!

Absolute motion always specifies the distance to move referenced from the top margin at the left bound of the logical page (0,0).

RE: Envelope Manual feed

Yes, the default page size is letter, which is what I programmed for. Aparently, the Esc&l3H chnges the default page size to some value which I cannot find in any documentation I have. But what I would like to know is what abvantage does "manual envelope feed" have over just plain "manual feed"?

The default font is 10 cpi Courier. This is true for all HP LaserJets that support PCL5. If I specify Esc(s6T I get a 10 cpi Gothic font if there is one resident. This is nice for headings.

One beef I have with HP is that they do not acknowledge the existence of #61/2 envelopes, which is the only small size commonly avaiable around here.

RE: Envelope Manual feed

It would seem that even with the 3H the default should be letter.

What the 3H does for(to) you, is that it won't jump to another tray if the manual tray
is empty. I don't how this may differ from 2H which is simply manual feed. Perhaps we
have two commands that do the same thing at the moment leaving room for expansion or
printers may have different capabilities.

You generally seem to rely upon printer defaults much of the time. It is a bad idea and will
come back to bite you. Always define the page format parameters completely as well as the
font select and symbol set when you change fonts.

Your (s6T is a BAD font command in this context. I believe that 6T is for helvetica, a proportional
font. But you are using the default Courier which is fixed pitch. There is no fixed pitch
helvetica, so the printer does its best to substitute. The spacing hs priority of typeface
you are for sure going to get a fixed pitch font. Given the 6T command it was quite possible
you would still have been left with Courier. Maybe because Helvetica is sans serif it switched
to letter gothic. BTW Letter Gothic is 4102T.

As far as small envelopes are concerned, there is a minimum paper length required for the sheet to navigate its way through the printer. You printer manual may contain this info.

Jim Asman

RE: Envelope Manual feed

Helvetica i 4T. 6T is just plain Gothic. The printer searches for a font that has the attribute Gothic. If it finds Letter Gothic first, then that is what it uses. As far as I can determine, my printer does not have Letter Gothic, but it does have several other Gothic fonts. I don't know what the difference is, what I get looks like Letter Gothic to me.

BTW, accouring to the documentation I have, later models do not have 0-line printer, 1-pica, or 2-elite. If you select one of these, you get Courier at 16.5, 10 or 12 cpi respectively.

As to using defaults, I just about have to. I have no idea what commands the target printer will suppot. If the reports coma out weird, then I guess I's have to ask the costomer for a copy of the manual for his printer. As a final fall-back, I can sllways just send raw text, with Line feeds, carriage returns, and form feeds. Maybe even allow the customer to pick it up in Word to format the way he wants it.

RE: Envelope Manual feed

Just how old is your printer?

I don't think that any of the HP LaserJet printers (or clones) have had printer-resident fonts, which use the base typeface values, since LaserJet III, or perhaps even LaserJet II.

The move to typeface values higher than 4096 probably coincided with the move from PCL4 to PCL5.

All modern LaserJet printers and clones (except for the cheap host-based devices), support PCL5 (either PCL5e for monochrome, or PCL5c for colour devices).

With modern LaserJet printers:
  • Letter Gothic (a fixed-pitch font) has typeface value 4012 (note that this is 4096 + 6).
  • Arial (a proportionally-spaced font) has typeface value 16602 (this is (4096 * 4) + 218); this was made available instead of Helvetica, probably due to licencing costs.
  • Helvetica (a proportionally-spaced font) has typeface value 24580 (this is (4096 * 6) + 4); this font is available on some of the newer (and more expensive?) models.
I agree with Jim about the need to fully initialise the printer to a known state, rather than relying on User Default Environment settings (which can often be changed by anyone with access to the front panel of the target printer).

In particular, use of partial font select sequences:
  • Requesting typeface 24580 may select one with typeface 4 (on a really old printer) if the former is not available, but the latter is present.
  • I'm not sure if the reverse applies (i.e. would requesting typeface 4 select the one with typeface 24580 if the latter was the available one?
  • Just selecting typeface 4 may result in a Helvetica font, but may not, since typeface is the least significant of the characteristics taken into account in a font select action.
  • In particular, if the current font is a fixed-pitch font, then selecting typeface 4 or 24580 (as appropriate) will not select Helvetica, since this is a proportionally-spaced font.
  • Similarly, if the current font is a proportionally-spaced font, then selecting typeface 6 or 4102 (as appropriate) will not select Letter Gothic, since this is a fixed-pitch font.
  • The most significant font selection characteristic is the symbol set (coded character set), so if this is set to an inappropriate value, then there may possibly be no font available which matches the remaining characteristics.
The concepts of pica and elite (as used with the obsolete <Esc>&k#S 'Pitch Mode' escape sequence) may still work, but are deprecated; you should instead use full font selection sequences.

RE: Envelope Manual feed

Front panel? I haven't seen a front panel on a low- or mid-range HP printer in years.

You may have noted that I start my print jobs with Esc E, as Windows does not reset the printer after a print job.

Yeah, I guess my LaserJet 2200d is older. But I put my 6L in the trash years before I got this one.

RE: Envelope Manual feed

>> ... Front panel? I haven't seen a front panel on a low- or mid-range HP printer in years. ...

Agreed, they don't tend to be used on the low-end devices; I have two printers:

LJ 1320n: has no front panel, but does have an Embedded Web Server (EWS) via which many PCL configuration settings can be made.

LJ M475dn: MFP with touch-sensitive front panel and EWS.

>> ... as Windows does not reset the printer after a print job ...

To my knowledge, all standard Windows PCL5 printer drivers 'top-and-tail' print jobs with the Univeral Exit Language (UEL) escape sequence (<Esc>%-12345X) which has the same effect as the Print Reset (<Esc>E) escape sequence, but also puts the printer into PJL mode.

So after any Windows print job has finished, the printer defaults should be the User Default Environment settings, as defined via front panel menus, or the EWS equivalent (for network models), or via special PJL 'set PCL defaults' jobs.

Since your quite old (> 10 years), low-to-mid range, printer doesn't have a front panel, nor EWS access, you may (I don't know) be able to obtain a PCL typeface list using a special PJL job:

Set up the following in a file (e.g. typefaceJob.PJL):

CODE -->

<Esc>%-12345X@PJL DMINFO ASCIIHEX = "040004010105020402015E"<LF><Esc>%-12345X 

<Esc> represents the Escape character (decimal code 27, or hexadecimal 1B).
<LF> represents the Line Feed character (decimal code 10, or hexadecimal 0A).

Then send the contents of the file direct to your printer; how to do this depends on connection; for parallel-port, you'd use something like the following from a Windows command-prompt session:

CODE -->

copy  /b  typefaceJob.PJL  LPT1: 

As regards selecting the LJ 2200 paper trays, the User Guide manual (reference bpl10361.pdf) for this family of printers refers to various tray identifer settings including:

CODE -->

2 = manual feed, paper
3 = manual feed, envelopes 

Envelopes must be placed in tray 1 with "... short-edge in, print-side up. The stamp end must enter the printer first ...".

The recognised # values for envelopes with the 'Paper Size' escape sequence (<Esc>&l#A) on this printer are:

CODE -->

80 = Monarch
81 = Commercial 10
90 = DL
91 = International C5 

The correct value must be used, as otherwise the printer won't know how far the left-edge of the envelope is from the (leading) right-edge.

RE: Envelope Manual feed

This is fantastic! I have been wishing for such a command string for years. With the 6L, I could get the list by holding certain button(s) down while booting. But that does not work with later models.

Also, I bought the printer used and did not get a user manual. So thanks for the referance to that too.

Catch a star!

RE: Envelope Manual feed

Using the above command string, I have found that my printer has 103 resident fonts, including Letter Gothic, and line printer. (Line printer is restricted to 11 symbol sets, which are listed as separate fonts.)

There are not 103 type faces though, as each font has its own conbination of attributes bold, italic, condensed, etc. Some of the Courier fonts have the "oblique" attribute instead of "italic". The command for oblique is the same as for italic. Universe is the only typeface with all 8 combinations in residence.

The line printer fonts can be at 16.67 or 8.5 cpi.

Although you can specify any 3-digit fractional number for the pitch of fonts such as Courier or Letter Gothic, what you will get is an integral number of raster dots for the width of each character. For instance, if you specify 16.5 cpi, you get a character specing of 36 dots (at 600 dpi), which is 16.67 cpi.

RE: Envelope Manual feed

There is only ONE lineprinter font. Specify BOTH size parameters and the relevant symbol set; e.g., <esc(10U<esc(s0p16.67h8.5v0s0b0T Apparently, you should use BOTH parameters to avoid conflict with another font. I'm sure that dansdad can give you the details on that.

As far as scaling goes, when you specify a given pitch or cpi the printer will divide the pitch into the current dpi setting to get the character pitch. Now if the result of the division does net come out exactly to a value with no fractional component, the result will be rounded up if the fraction is .5 or greater or the fraction will be discarded of it is less than .5. It is quite possible that you could get at a given cpi you could get a different spacing depending on the current 300/600 dpi. This is a silly example, but it illustrates the point. Lets say a cpi of 40. A dpi of 600 would render a pitch of 15 pixels per character, but at a dpi of 300 we get a pitch of 7.5 which the printer rounds up to 8 pixels per character @ 300 dpi which is the equivalent of 16 pixels @ 600 dpi. That is one pixel wider than when we were at 600 dpi. Most of the time this "rounding error" can be ignored, but there are occasions when it must be exact. In that case you must use the 'horizontal motion index' command to set the cpi to your liking.

A real world example would be printing the MICR data at the bottom of a check. The character spacing is required to be 8 cpi exactly. A 600 dpi it works out to 75 pixels exactly, so no problem. At 300 dpi however, we get 37.5 which rounds up to 38 pixels, a 76 pixel 600 dpi equivalency, which makes the actual spacing greater than the 8 cpi we must have. Thus the HMI is absolutely necessary to meet the banking specifications @ 300 dpi.

Jim Asman

RE: Envelope Manual feed

@webrabbit: I'm happy that I've been able to pass on some useful information.

>> ... The line printer fonts can be at 16.67 or 8.5 cpi ...

As Jim notes, there is only one Line Printer font (more accurately, one per supported symbol set), and it is selected using BOTH point and pitch values, because it is a fixed-pitch bitmap (non-scalable) font.

There are four combinations of scalability and spacing:
  • scalable fixed-pitch: only pitch is relevant; Courier and Letter Gothic are the only standard ones, although some modern printers also provide Courier PS, Koufi and Naskh fonts.
  • scalable proportionally-spaced: only point-size is relevant; most of the resident fonts (e.g. Arial and CG Times) are of this type.
  • bitmap fixed-pitch: both point-size and pitch must be specified; Line Printer is the only one available on modern LaserJet printers.
  • bitmap proportionally-spaced: only point-size is relevant; modern LaserJet printers don't provide any of these.

>> ... Universe is the only typeface with all 8 combinations in residence ...

I tend to think of there being two font families (Univers and Univers Condensed) which each have all four standard variants (Regular, Bold, Italic and Bold Italic)

RE: Envelope Manual feed

I should point out that my previous reference to dpi was not about the printer resolution, but rather 'user units' defined with <esc>&u300D for 300 dpi or <esc>&u600D for 600 dpi. The default is 300. To distinguish between the printer resolution and user units, I will call the user units upi.

It is about the scale of the PCL coordinate system. This means that <esc>*p100X would be an indent of 1/3 inch at 300 upi and only 1/6 inch at 600 upi. A change in user units has no effect whatsoever on the resolution used by the printer to render the font.

Jim Asman

RE: Envelope Manual feed

Yes, I noticed that the 8.8 was the point size shortly after I posted the above.

I discovered on my own that the units-of-measure command has no bearing on the font resolution.

Yes, Univers is the only resident typefase that has all six possible combinations of bold, italic, and condensed. Note that italic and condensed are both specitfied with the "s" subcommand. Italic is specified with a value of 1, condnesed with 4. Italic condensed is 5. The Techical Reference Guide lists several other values too.

The command string caused my printer to print the font listing, but just caused a form feed on the client's, an HP LaserJet Pro P1606dn.

BTW, the PRINT command can print to any local lptN: or comN: port (does any new computer have such a port?) or to a network printer. A local USB printer must be conveted to a network printer by sharing it. You can temporarily assign a network ptinter to an lpt or com, but it still has to be a network printer.

RE: Envelope Manual feed

>> ... The command string caused my printer to print the font listing, but just caused a form feed on the client's, an HP LaserJet Pro P1606dn ...

The LaserJet Pro 1606dn specifications state that it supports both host-based printing and PCL5e, but it seems that it perhaps does not support PML (as used in the referenced command string).
As it is an 'n' model, there may be a means of invoking the printing of various information pages via the Embedded Web Server interface (if it has one).

Jim, I like your real world (MICR) example of why it is often better to use 600 PCL units-per-inch than the default 300 upi value.
I've used 600 upi since I first worked with LaserJet III Si devices (but I've never found a need to use higher values (maximum is 7200 upi)).

RE: Envelope Manual feed

Just for historical "correctness" the 600 dpi first came with the LJ4.

I rarely use 600 upi myself. Even on something like the MICR I will change the upi to 600 just for that data and then back to 300.

The best use that I have for 600 is when I am creating a form and set the line spacing to zero and use x,y for positioning. That is fine until you have need to do a series of "LF's" at 8 lpi. It's hard to advance 37.5 on the y axis.

Jim Asman

RE: Envelope Manual feed


I just reread you last post. I don't know what the capabilities of the 3si were, and as it was later the the LJ3, maybe it did support 600 dpi.

The thing I find curious about the real dpi resolutions wars is that while the printer may be able to address 1200 dpi or whatever, the toner particles are probably significantly larger. I bet that a raster image that had alternating B&W pixels would print solid black even at 300dpi. Of course the devices that use photographic paper it is a different matter and those things don't need to dither either.

Jim Asman

RE: Envelope Manual feed


I can't be sure that the III Si was a 600 dpi device, I only have hazy memories of that long ago.

As regards the effect of different resolutions, one topic (see ), which we both contributed to, was to do with generating user-defined patterns at 600 dpi resolution to improve shading compared to the built-in (300 dpi) shading patterns.

RE: Envelope Manual feed

I vaguely remember that thread. How do you have that kind of thing indexed to recall it? Or did you simply do a search on resolution?

Jim Asman

RE: Envelope Manual feed

I don't have a magic indexing system, or an ESP interface - I vaguely remembered the topic and just did a search of my previous posts to find it.

RE: Envelope Manual feed

It's easy to set 8 lpi. Just use the command Esc &l6C or Esc &l8D. Note that the vaild values for Esc &l#D are those that result from integral values of Esc &l#C, but Esc &l#C accepts non-integral values; I use Esc &l4.8C for 10 lpi.

RE: Envelope Manual feed

You misunderstand what I was doing. I turned line spacing off with <esc>&l0C

Then I was using PCL code to position text, not relying on the linefeed ...

<esc>*p120x800YSome Text
<esc>*p120x+50YSome more text
<esc>*p120x+50YLine 3

Using the relative +50Y(6 lpi @300 upi) I can very precisely control the line
spacing. My point was that at 300 upi, I couldn't get 8 lpi exactly. It is
easily dealt with, but you still have to deal with it. Of course it is not a
problem @ 600 upi.

We should probably move this to another thread if we continue.

Jim Asman

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close