Solved

Is it possible to count lines

Posted on 2001-06-13
13
172 Views
Last Modified: 2010-04-09
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?

MORE INFO ON MY DESIGN:
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?
0
Comment
Question by:LMylan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +4
13 Comments
 
LVL 8

Expert Comment

by:edemcs
ID: 6187112
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.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6187292
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.


Cd&
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6190221
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....

Max.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6190541
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.

Cd&
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6190662
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.
0
 
LVL 1

Accepted Solution

by:
Ernest022699 earned 50 total points
ID: 6209143
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 (http://wimpy.arsdigita.com/) 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.
0
 

Expert Comment

by:teacher_mod
ID: 6374503
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.

teacher_mod
Community Support Moderator
Experts-Exchange
teacher_mod@experts-exchange.com


0
 
LVL 1

Expert Comment

by:Ernest022699
ID: 6374934
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.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6375550
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.

Cd&
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6375819
Give it to Ernest... he gave a good explanation, somebody might actually listen to him for a change. ;-)
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6375966
I agree....give points to Ernest...

Max.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6520245
It is time to clean this abandoned question up.  

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

<recommendation>
POINTS TO Ernest

</recommendation>

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

Cd&
0
 
LVL 1

Expert Comment

by:kodiakbear
ID: 6521663
Accepting Ernest's comment as answer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Html Newline 7 30
HTML5 storage and web apps 11 44
Link not working 6 41
Table doesn't show the lines! 3 23
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question