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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to change margins and spacing

Status
Not open for further replies.

henningp

Technical User
May 2, 2012
15
0
0
US
We are trying to change the margins and spacing and when we add those specifics, nothing changes. this is what we are using right now: ^[&l5E^[&a1L^[&a1M^[&l9D^[&l1O^[&k2S

We are new at this and have gotten things working with just the landscape and size:^[&l1O^[&k2S

but no changes when things are added. Any help would be appreciated.
thanks!
 
>> so would you assume that it isn't PCL5 since the commands you recommended didn't work?

>> things are starting to look right

So what have you done in between these two statements that appears to have improved the situation?

As Jim says, it's very difficult giving advice if you are only telling us (very) small bits of the story!
It can't be that hard to find out what make/model of printer you are using, surely?


>> ... problems with the spacing. It is showing up as double spaced ...

The sequences which Jim suggested should have set the line-spacing to 9 lines-per-inch, for subsequent LineFeed-terminated lines.

We need examples of what you are setting, and what your data looks like.


... and did you try the sample file I attached in an earlier post?
Just 'send' the contents of it direct to the printer port.
What results do you get? Do they match the brief description I gave?
 
9 lpi would be esc &l5.3333D

or to get slightly tighter spacing, try esc &l5D.
 
henningp:

I agree with Jim.

The JPEG doesn't show us anything - there is nothing in it to show the scale.

... and we need a 'capture' of the PCL and data being sent to the device, in order to see what sequences are present, and in what order relative to each other and to the embedded data .


webrabbit:

>> 9 lpi would be esc &l5.3333D

No, it wouldn't; that would set line-spacing at 5.3333 lines-per-inch.

<Esc>&l#D sets line spacing at # lines-per-inch.

You are confusing this sequence with the 'Set VMI' sequence, which sets Vertical Motion Index (a more precise method of line spacing).

<Esc>&l#C sets VMI at #/48 inch.

e.g.:

<Esc>&l5.3333C sets VMI at 5.3333/48 inch; this is equivalent to 9 lines-per-inch (i.e. 48/5.3333).
 
No! That is not right. You are correct that where I had used 9d which isn't legal.

You have the right idea, but the correct command is

^[&l5.3333C

Note the C.

So try for the page format...

^[&l2a1o5.3333c5e63F


Jim Asman
 
... and just to clarify what the latest "this is what we have" sequences signify:

Code:
<Esc>&l14D        Line Spacing (14 lines per inch)
<Esc>&k3H         Horizontal Motion Index (3/120 inches)
<Esc>&l5E         Top Margin (5 lines)
<Esc>&l1O         Orientation: Landscape
<Esc>&k4S         Pitch Mode: Elite (12 cpi)

Note that:

(a) The 'Set Orientation' sequence will (amongst other things) reset the top margin (probably to 1/2 inch), thus effectively ignoring the previous 'Top Margin' sequence (which set it to 5/14 inch).

(b) The 'Pitch Mode' sequence (setting 12 characters-per-inch) will probably over-ride the previous 'Horizontal Motion' sequence (which effectively set horizontal spacing of 120/3 characters-per-inch!).
... and (as I mentioned before) the 'Pitch Mode' sequence is considered to be obsolete.
 
As Jim points out, with the 'Line Spacing' sequence:

<Esc>&l#D

only a limited-value set is allowed for the # value:

0,1,2,3,4,6,8,12,16,24,48

Other values are ignored - and I've no idea what a value of 0 signifies.
 
>> I've no idea what a value of 0 signifies

It means just what it implies. The VMI is zero. I do this from time to time in coding a form and provide the Y-axis co-ordinate at the beginning of each line when the VMI is zero. I usually use ^[&l0C though.


Jim Asman
 
Sorry, the terminating character should have been "C".

esc &l5.3333C

or esc &l5C.

Either number with a "D" would be illegal and ignored.

In order to get spacing other than one of those offered with the "D" option, you must use the "C" option.
 
webrabbit:

I'm sure that we've all suffered from 'typos', or occasional lack of concentration, when formulating responses in these (and similar) forums.

The important point you raised, that Jim and I had missed up to that point, was that the 'Line Spacing' sequence only accepts a limited range of values - and 9 and 14 are not in that set.

I'll make a change to the 'PRN File Analyse' tool, in the next release, to make this clear; e.g.:

Code:
<Esc>&l9D         Line Spacing (9 = lines-per-inch unknown/illegal value)

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top