Is it possible to count lines

I am generating html in a vb dll to be displayed in a frame for printing by the user.  I need to place an image at the bottom of the each printed page (like a footer).  Is there a way to count lines?  
In my old word processing days I could determine how much of the page had been used by getting the pts size off the font being used.  Now in html with tables and
's, I was wondering if there was an easy way to assess line count.  Can anyone tell me?

My design consists of storing multiple templates in a database.  A header, a body and a footer.  The body is used to present the data elements on the page.  At some point I need to stop placing data elements on the page and put the footer down, before starting a new page.  I was considering adding a field to the database and record the base count of lines each template uses, and then in code add lines as the body of individual data grows, or subtract lines for the items the user wants to supress from print.  Is there an easier way?  Like a Height property on an image?
Who is Participating?
Ernest022699Connect With a Mentor Commented:
It is A Bad Idea to try to format a Web Page as if it were printed documentation.  If you wanted to do faxing, then you'd be in the right ballpark, but not on the Web.

A different mindset is needed.  Here's the basic premise:
Users need to see a comfortable lump of stuff at once.  How much constitutes that lump depends on whether it is solid text in paragraphs (not optimal), text and light graphics (ideal), or mostly graphics (too long to load).  

If you haven't been to WimpyPoint ( it is well worth the trip to see some of the presentations as well as the book excerpts!

Each Page should contain a lump that belongs together.  If you're writing about your seven-day hike, then breaking it down into seven Pages makes sense.  Put a series of "previous", "beginning", "next", and "home" links at the bottom of each Page and the user will probably be happy.

You must always keep in mind that people may be using text-to-speech or Braille browsers, for example.  Those people probably won't ever be printing your Pages.  Because screen sizes vary all over the lot, each user's window can be a different size.

If you'd like to tell us what kind of thing you'll be publishing I'm sure we can give you suggestions about breaking the data into manageable Pages.  Don't try to control the user; it won't work.
Because this is a webpage you are talking about, you can have an infinite number of lines.  So you need to design a template that is so many lines long, and build your pages dependent upon that format.
If you are doing this for an intranet app, where you have total control of
browser and printer setting you might be able to do this.  In all other cases
there is no chance you will optimize the printing.  The format of the printed
page is affected by resolution, preferences setting, local browser options,
local print settings and the whim of the user.  

HTML pages are optimized for screen display and do not print well under even
under ideal conditions.  The standard approach is to the document in printer
fiendly format like PDF.

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Well...if you would place all the lines in a layer you should be able to calculate the height using the height of the contents of that layer devided by the lineheight of the layer....

The problem is printing so count the number of lines you think should go on a page put in the image and after the image add:

<p style="page-break-after:always">&nbsp;</p>

Works in IE only guarantees you will page bread at the specified point, but does not guarantee the formating will be ideal.

And it still doesn't ensure that they've got the printer you assume they'll have -- or that they've not got it set landscape, or have different paper loaded, or a different paper cartridge selected, etc. You won't know, and they can change any printer settings without reloading the page, so you have no way of knowing -- no matter what you check or how many scripts you run.

Don't use HTML for anything that you want printed a certain way. It's bound to print wrong for somebody -- and the more you try to control it, the more people it's going to be wrong for.
This question has been abandoned. Would the experts please indicate how
this should be closed out. Is there a comment which should be accepted?
Should the points be split? Should it be reduced to zero points and PAQed?
should it be deleted?  In the absence of direction, the default will be
for me to delete.

TIA for helping to clean up the old questions.

Community Support Moderator

teacher_mod: This is one of the extremely few times when you will see me asking to have my comment accepted as the answer.

My second choice is to have you split the points among us.
These very often end up split.  Give it to Ernest, we at least got something a little different on this one.  If you are going to split, give my share to Ernest anyway.

Give it to Ernest... he gave a good explanation, somebody might actually listen to him for a change. ;-)
I agree....give points to Ernest...

It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.



If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Accepting Ernest's comment as answer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.