I need to get the display height of a webpage when rendering in IE.
I am currently using the WebBrowser control to load an HTML page, and then find the clientHeight document (or scrollHeight, I forgot that). It works well.
The problem is that I need this code to run from a web service as a result of calling an API and launching a Windows Form-based control to load in a WebBrowser control is an ugly and (I suppose) incredibly resource hungry.
So, is there a mute browser implementation that would allow me to determine the likely height of the displayed HTML? I know this will not work for iframes, divs that scroll, etc., and it does not have to be super accurate (within 200px it will be fine).
The HTML pages we are testing range from 700 pixels to several thousand pixels, so calculating an approximate height would be ideal. The HTML used tends to be quite simple, as these pages are HTML emails extracted from email and sent to a web browser.
source share