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

Lines/Page

Status
Not open for further replies.

darkfin

Programmer
Dec 3, 2002
1
ES
Hello,

i´m printing with pcl commands with visual basic to an
hp 5l printer. The problem is that the original page to
print has 66 lines and the printer only prints 64 per page.
Can I change the number of lines with a pcl command?
Can I change the page format (a4,etc..) with pcl?

Thanks
 
You can issue PCL code to format the page as it suits you, however, if your print job is being processed by a windows print driver, then that could undo your efforts.

Otherwise 20 bytes or less of PCL code will fix you up. You will have to tighten up the linespacing a bit to print the 66 lines on the page. Jim Asman
jlasman@telus.net
 
I agree with other Jim that often the driver will undo your VB/PCL stuff; we found that even with the generic text-only driver once before.

An alternative is to use what MS refer to as 'raw printing', a la this link:
If you put the code for the pcl escape sequence in the variable sWrittenData you'll see that the escape gets through to the printer, along these lines:

Code:
sWrittenData = Chr(27) & "&. 'whatever the escape code is

If you don't have the Pcl manuals to hand, which describe all the commands, there's a post lower down in here with a url for electronic copies.
Jim Brown,
Johannesburg,
South Africa.
My time is GMT+2
 
You will not be able to print 66 lines on a laserjet or inkjet printer. This is because there are "unprintable" areas on these type printers. With older dot matrix printers with continuous paper you could just keep printing if you wanted and the lines continued. Actually that will happen in most cases with laserjets too but it will not print in the unprintable portions.

About the most you can hope for is 64 lines at 6LPI using
chr$(27)+"&l6c6d66f0l0o0E"

You can set the LPI to about 84 using 8LPI or other and yes you can set the paper type with PCL.

chr$(27)+"&l#A"
that's ampersand lowercase L and a number
This sets the page size
Values should be:
1=Executive 7.25" x 10.5"
2=Letter 8.5 x 11
3=Legal 8.5 x 14
26=A4 (210mm x 297mm)
80=Monarch (3.875" x 7.5")
81=Commercial (4.125" x 9.5")
90=International DL (110mm x 220mm)
91=International C5 (162mm x 229mm)

There may be more and these may or may not all be supported on your printer - the first 3 should work for sure

Set Page Length
chr$(27)+"&l#P"

Papersize Portrait Landscape
6LPI 8LPI 6LPI 8LPI
Letter 66 88 51 68
Legal 84 112 -- --
A4 70 93 49 66
Executive 63 84 43 58

Left Margin Right Margin Top Margin
EC&a#L EC&a#M EC&l#E

Text Length
EC&l#F
Note: when sending top margin and text lenght send top margin first.

Line Per Inch
EC&l#D
(EC stands for escape character hex 1B dec 27)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top