Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Envelope Manual feed 3

Status
Not open for further replies.

webrabbit

MIS
Jan 31, 2003
1,059
US
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?
 
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
 
It is an HP LaserJet 2200D
Here is the data sent:
Code:
~E~&l2h1o29E~&a40L      
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 6[sup]th[/sup] 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.
 
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
 
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
 
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:

[ul]
[li]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.[/li]
[li]Using X and Y positioning sequences, the values are relative to the current left and top margins.[/li]
[/ul]
 
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).
 
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 #6[sup]1[/sup]/[sub]2[/sub] envelopes, which is the only small size commonly avaiable around here.
 
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
 
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.
 
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:
[ul]
[li]Letter Gothic (a fixed-pitch font) has typeface value 4012 (note that this is 4096 + 6).[/li]
[li]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.[/li]
[li]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.[/li]
[/ul]

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:[ul]
[li]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.[/li]
[li]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?[/li]
[li]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.[/li]
[li]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.[/li]
[li]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.[/li]
[li]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.[/li]
[/ul]

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.
 
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.
 
>> ... 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

where:
<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.
 
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!
 
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.
 
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
 
@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:
[ul]
[li]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.
[/li]
[li]scalable proportionally-spaced: only point-size is relevant; most of the resident fonts (e.g. Arial and CG Times) are of this type.
[/li]
[li]bitmap fixed-pitch: both point-size and pitch must be specified; Line Printer is the only one available on modern LaserJet printers.
[/li]
[li]bitmap proportionally-spaced: only point-size is relevant; modern LaserJet printers don't provide any of these.
[/li]
[/ul]


>> ... 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)
 
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
 
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.
 
>> ... 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)).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top