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

Help on calculating available lines to print on legal size

Status
Not open for further replies.

angelleynes

Programmer
Dec 28, 2001
46
US
help anyone on how to calculate available lines to print on legal size, basically we're using the @say command to print documents on legal size and letter size and need a solution on how to start printing to the next page when it is needed.

thanks!
 
Are you printing Text only?
This is how I do it.
For x = 1 to 100
@ x,1 say ltrim(str(x))
endfor
** Above is to get the line or # of lines possible on the paper **

I print it on the legal paper, and then from there, I know the Row the last line printed.

in your printing @ Say stuff, check for the PROW() if it reached the "margin" you saw on the paper.

that's how i used to



Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
The biggest problem you'll run into is different printers. Some can print the entire page, while others have effective top and bottom margins that can't be printed in. It really does depend on the hardware and to some extent the printer driver in use. If you need consistency for all your users, about all you can do is determine the "worst" case and use that for everyone.

Rick
 
Hi angelleynes,

Pls try this sample, it's been a long time seem's i using this command.

_peject='NONE'
lctr=2
pg=1

set device to print

do whil .t.
@ lctr, 3 say "XXXXXXX"
lctr=lctr+1
@ lctr, 3 say "YYYYYYY"
lctr=lctr+1
if LCTR>=76 && change Value to Higher if Necessary
lctr=2
pg=pg+1
eject
endif
if pg=4 && trigger to exit Do Whil condi.
exit
endif
enddo
set print off
set print to
set device to screen

:)
OMR

 
I've always started with the pattern based upon the 8.5x11 common size page. Using Courier fonts at 10 CPI and 6 LPI, that gives you 66 lines maximum on a sheet. It is often best to throw out the 6 bottom lines for appearance and due to the aforementioned limitation on not being able to print out to the very end of the sheet. If you want one inch margins from the top then allow for that within your program code by using empty lines. As for the limits, I think most HP printers cannot print on the 0.25 inch margins all around.

Now for legal 14 inch paper you'll get 84 lines (14x6) maximum, but you may want to standardize on 78 lines per page and ignore the bottom six lines.

Of course other fonts, pitch and sizes will change the number of lines and you'll have to test while in those fonts as suggested by the others.
 
Angellleynes,

You can get the answer to your question without any programming and without resorting to trial and error.

Just take the point size of your selected font, divide it into 72, and multiply the result by the height of the paper in inches.

Mike





Mike Lewis
Edinburgh, Scotland
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top