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

Top Margin

Status
Not open for further replies.

dsaro00

Programmer
Apr 18, 2005
14
US
We are in the process of developing printing applications from mainframe. Our issue is with the top margin. Our top margin starts about 2 inches down from the top of the page. We want to shift the top margin up, but we are not able to. The top margin command we have used is &l0E (with a preceeding escape character of course). We used the default paper size 'Letter'. When we change to A4, the top margin gets shifted. But we need this shift on 'Letter' size. Any idea how this can be done?

These are the other page setup parameters we have given.
&l6C for VMI
&l8D for line spacing
&l0O for Portrait setting etc

Thanks & Regards
DSARO00

 
As you have stated it, there should be NO top margin at all, so there must be something else going on.

We will pretty well need to see the PCL code that is creating such a HUGE margin. Are you sure that your application isn't sending a dozen LF's at the beginning of the print job? What model of printer?

Email to:

jlasman at telus dot net

Jim Asman
 
Every command issued ending with a linefeed character will make the print position one more line down.

Once you set the paramaters, how about sending a code like
&a1R

Now, if this is terminated by a linefeed character, the cursor will be at line 2.

 
No, that code puts the cursor on the second line.

<esc>&a0R puts the cursor on the first line.

Jim Asman
 
Hi,
We issue the PCL commands from a COBOL program residing in the mainframe. I am not pasting the COBOL code here. I'll give just the list of PCL commands alone in the same order as they appear in the COBOL program.

%-12345X
E
(s0p10v0s1b4101T
*c1d6F
(0N
(s0p12v0s3b4101T
*c2d6F
(0N
(s12H
&k10H
%0B;
IN;SP1;PW.3;DT*;
SD4,11.5,6,3;FI2;SS;
PU3915.45,10322.6;LBTEST REPORT 1805*;
SD4,10,6,3;FI1;SS;
PU4881.6,9102.15;LBReport Number =>*;
SD4,12,6,3;FI2;SS;
(s12H
&k10H
PU0840.72,7878.36;LBCUST NUMBER*;
PU2200.11,7878.36;LBINVOICE - DATE*;
PU3667.98,7878.36;LBDEBIT MEMO ISSUED BY*;
PU5786.73,7878.36;LBCHANGE/CANCEL APPROVED*;
PU0840.72,7102.05;LBDESCRIPTION*;
PU5112.12,7102.05;LBQUANTITY*;
PU6013.86,7102.05;LBUNIT PRICE*;
PU7271.55,7102.05;LBAMOUNT*;
(s13H
&k9.23H
PU813.6,10220.9;PD8132.61,10220.9;
PU0813.6,593.25;PD8132.61,593.25;
PU0813.6,0593.25;PD813.6,10220.9;
PU8125.83,593.25;PD8125.83,10220.9;
PU8125.83,593.25;PD8125.83,10220.9;
PU813.6, 8017.35;PD8125.83,8017.35;
PU0813.6,7583.43;PD8132.61,7583.43;
PU2179.77,7583.43;PD2179.77,8024.13;
PU3647.64,7583.43;PD3647.64,8024.13;
PU5732.49,7583.43;PD5732.49,8024.13;
PU0813.6,7295.28;PD8132.61,7295.28;
PU0813.6,7007.13;PD8132.61,7007.13;
PU5078.22,593.25;PD5078.22,7298.67;
PU7085.1,593.25;PD7085.1,7298.67;
%0A;
&l0O
&l-500Z
&a11L
&l0E
&l6C
&l8D

When I used the offset command (&l-500Z), the top margin seems to shift up by 3 lines. Do you think it is a good idea to use the offset command? Will this command produce different results in different printers?

We are now printing to a primitive N24 printer from Xerox, but we will be converting to HP/Lexmark combination soon. We may be purchasing HP/Lexmark of atleast 3 or 4 models. We want our code to produce the same result on all printers. Do you think that is possible? What are the PCL commands that might behave differently in different printer models?

Thanks for your help
DSARO00
 
Some observations...

I'm not sure what the lone <esc>%-12345X is doing at the beginning.

Your font commands at the top are wrong. They should begin (s1p

Your linespacing and margin commands FOLLOW the HP-GL/2 code!

You have PCL commands in the middle of HP-GL/2 code

Your life may get easier if you adjust the HP-GL/2 addressing scheme to be congruent to the PCL page.

All the page definitions, margins should be first in the print stream. You are relying on printer defaults for the layout of the HP-GL/2 page and it is my guess that there is some printer control panel setting that is giving you the unwanted margin.

If you are going to have a variety of printers using the same PCL code, then you are pretty well committed to issuing PCL to format both the PCL and HP-GL/2 at the onset of the job.

There is HP and there is HP Compatible. Not necessarily the same thing! You really want the printer init to specify all the parameters.

There is nothing inherently problematic with the offset command, but it would more than likely be used to fine tune the placement of text. You have something else going on that you want to sort out.

Jim Asman
 
Why is the font command at the top wrong.
Im not sure about the font family 4101 although i could look
it up, just says to me fixed pitch probably about 12 cpi bold.
 
I concur with all of Jim's points.

In particular, you need to explicitly set the size and position of the HP-GL/2 picture frame (the bottom-left corner of this is the HP-GL/2 origin point), otherwise you'll get a default frame (and hence HP-GL/2 origin) the position of which will depend on front panel settings and paper size.

Specify the PCL Picture Frame dimensions using the
{esc}*c#X (Picture Frame Horizontal Size - decipoints)
and
{esc}*c#Y (Picture Frame Vertical Size - decipoints)
commands.
This defines the logical boundaries of the picture frame.

Then 'anchor' this picture frame to a known position (the 'current' PCL cursor position) using the
{esc}*c0T (Set Picture Frame Anchor Point)
command.
This command determines the position, on the PCL logical page, where the upper-left corner of the Picture Frame is placed. In conjunction with the vertical picture frame size, this will determine the HP-GL/2 origin.
 
Hi All,

Thank You for your inputs.

Will a change in font size affect the inter-character spacing (pitch) and line spacing?

Will changing line spacing affect the top margin and will changing the pitch affect the left margin?

Thanks & REgards
dsaro00

 
Pitch only affects fixed pitch fonts. You have chosen a proportionally spaced font. Character widths vary from character to character. You change the size by selecting the appropriate point size. As the point size increases, it gets bigger.

The point size of the font has NOTHING to do with the line spacing. That is a separate command.

Once you have initialized the page, a subsequent change in line spacing shouldn't change the margins. I'm not sure about a pitch change, but you can certainly test that very quickly.

Of course, this has nothing to do with your oversized top margin.

Jim Asman
 
Hi All,

1) Do you know if any command exists in PCL that can carry forward graphics from page to page?

2) I understand that in PCL only factors of 48 are accepted for line spacing, character spacing etc (2,4,6,8,12,16 and 24). If we give any other value, the command is ignored. What if I want a line spacing of 10. Is there a way we can circumvent this problem?

Thanks & Regards
dsaro00
 
PCL Technical Reference...Read it!

The line spacing command <esc>&l##D is in lpi and work only in factors of 48.

The command <esc>&l###C states the line spacing in 1/48's of an inch with a precision of 4 decimal places.

So, divide the desired lpi into 48 to get the correct argument for the command. Let's say you want 4.47 lpi.

(48/4.47)=10.7832

<esc>&l10.7832C would be the PCL Command. It's in the book.

<esc>&l4.8C would give your 10 lpi.

I don't know what you mean by carrying forward graphics form page to page. If you mean half an image on one page and the other half on the next page, I don't think so.

Read the chapter on macros.

Jim Asman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top