Forum How do I...?

How do I get the height of an element after rendering?

John
Hello,

I need to find out the height of an element after it was rendered by Prince. There is no need to change any values, just read them. Does Prince's Javascript engine run after rendering or only before?

Greetings,
John
mikeday
Before, but we have added a "complete" event which can be used to trigger JavaScript after layout has finished and a box tracking API to get element box positions and sizes. However at this point it is too late to modify the DOM, although you can log information and then use that to run Prince again for multipass operation.

Here is an example using JavaScript to create changebars.
John
Thank you mikeday. That's more than sufficient for our purpose.