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

Top and Left margin values

Status
Not open for further replies.

maurosilva

Programmer
Mar 21, 2010
5
0
0
BR
Hi all,

I'm trying to place my top and left margins for the minumum value that the A4 paper supports (0.42cm x 0.42 cm). However, this point (0,0) is shifted a little bit for down and rigth.

I'm using the pcl command related to Vertical Cursor Position (in decipoints) and Horizontal Cursor Position (in decipoints) setting zero for both value fields like: "&a0H &a0V".

Follows below the full commands in pcl:

%-12345X@PJL ENTER LANGUAGE = PCL
E
&l26A&l0H&s0C&l0O&a0H&a0VJOAO FELIPE SOUZA
E
%-12345X

any idea?

regards
mauro


 
An analysis of your print stream shows:

Code:
Sequence          Data / Interpretation
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
<Esc>%-12345X     Universal Exit Language (UEL)
                  Comment: Switch language to PJL
@PJL ENTER LANGUAGE = PCL
                  Warning: incorrectly terminated
                  Comment: Switch language to PCL
<Esc>E            Printer Reset
<Esc>&l26A        Page Size: A4
<Esc>&l0H         Paper Source: Unchanged (eject page)
<Esc>&s0C         End-of-Line Wrap: Enable
<Esc>&l0O         Orientation: Portrait
<Esc>&a0H         Cursor Position (decipoints): Horizontal
<Esc>&a0V         Cursor Position (decipoints): Vertical
JOAO FELIPE SOUZA
<Esc>E            Printer Reset
<Esc>%-12345X     Universal Exit Language (UEL)
                  Comment: Switch language to PJL

Note that the PJL statement should be terminated by a LineFeed character (optionally preceded by a Carriage Return character).
 
Following a 'set orientation' sequence, the cursor is moved to the left edge of the logical page at the top margin cursor position.

The 'set cursor position' commands set the cursor relative to the current margins.

------------------------------------------------------------

The top of the logical page coincides with the top of the physical sheet.
The left edge of the logical page is about 4mm inbard of the left edge of the physical sheet for most paper sizes.

These values are subject to some variation (typically +- 1.5mm) between printers (or even trays).

Some printers offer (via front panel menus or equivalent) the ability to adjust registration settings.

------------------------------------------------------------

The Left Margin command (<esc>&a#L) sets the left margin to the left edge of the specified # column.

The first column within a line is column 0, which is located at the left edge of the logical page.

The Horizontal Motion Index (HMI) setting (typically reset via font selection) defines the distance between columns.

------------------------------------------------------------

The Top Margin command (<esc>&l#E) designates the number (#) of lines between the top of the logical page and the top of the text area.

Default = 1/2 inch down from top of logical page.

The Vertical Motion Index (VMI) setting (reset via the 'set line spacing' or 'set VMI' sequences) defines the distance between lines.

 
I must eb getting old (I am!) - I mistakenly stated that "... 'set cursor position' commands set the cursor relative to the current margins ...".

They are actually relative to the logical page.

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

So if your &a0H&a0V sequences should set the Current Active Position (CAP) to (approximately) (6mm, 0mm) on the physical page (subject to registration variations).

Note that this is within the 'unprintable region' (having margins of about 4mm on all edges), so text and other markings at this position may be clipped.

Note also that when printing text, the 'baseline' is usually assumed to be 75% of the current VMI down from the CAP.
The default VMI is usually equivalent to 6 lines-per-inch.
 
... oh dear! I was almost right the first time!

The cursor position (0,0) is at the intersection of the left edge of the logical page and the current top margin position.

With A4 Portrait paper, and the default top margin, this equates to (0.237, 0.500) inches, or (6.01, 12.7) millimetres, relative to the physical sheet.

... subject to those registration inaccuracies.
 
To read all about PCL page control yourself (as I'm not having a good day of it trying to explain bits!), the following link provides a brief history of the PCL language, and links to the PCL Technical Reference manual, and also to other PCL5 & PJL manuals:


Be aware that some of the manuals (in PDF format) are multi-megabyte downloads.

Part 1 of the PCL5 Technical Reference Manual (bpl13210) describes logical pages, unprintable areas, cursor positioning, margins, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top