Search code examples
htmlpaginationpdf-generationpaging

How do I tell if an HTML element has gone off the bottom of a page?


I have a system that takes dynamic data, puts it in HTML for layout and then converts that to PDF. However the problem I am having is that if an element becomes too big for the remaining page space or pushes something else off the bottom how can I detect this and move the element myself to the right position on the next page? (Currently it gets in the way of the footer elements.)

Any ideas?


Solution

  • I found that by using the WebBrowser control and checking the OffsetRectangle.Bottom property of the element in question I could tell if it was lower than the top of the footer then I could tell if the element had overflowed and by how much.

    Thanks for your help anyway guys and gals.