how to find the height of html content
Posted
by ganapati hegde
on Stack Overflow
See other posts from Stack Overflow
or by ganapati hegde
Published on 2010-03-08T13:29:51Z
Indexed on
2010/03/08
13:36 UTC
Read the original article
Hit count: 442
Hi,
I am trying to display 10 html pages as a single document,with 10 chapters.
I am using Webkitgtk+ engine to render the HTML pages.
I am getting the content of each html files and concatenating all of them to create a
single 'char *content' and using
webkit_web_view_load_html_string(WebKitWebView *web_view,
const gchar *content, const gchar *base_uri);
this function to load all the HTML files, as a document.
Now i am trying to build a 'table of contents(toc)' for this document, which displays all the chapter names in order. My requirement is, when i click on a particular chapter in toc, the document should scroll to that point. For that i need to know height of each chapter ( height of each html file content).
The point to be noted here is, the width of the document can changed and as HTML is reflowable, as width increases height decreases and vice-versa. So each time when height changes i need to find out the current height of each HTML page(or chapter) and hence calculate the distance to be scrolled.
How can i find out the height of content of HTML page dynamically ? Thank you for the answer....
© Stack Overflow or respective owner