Forum How do I...?

How to get image size (height and width) in JavaScript for Prince..

phil_flowers
I've got a problem. I can't get dimensions of img element in JavaScript. All typical solutions like:

"document.getElementsByTagName('img')[0].height",

"...clientHeight"

or "...naturalHeight"

doesn't work and return 'null'. I've got an acces to the proper img element, but I can't get its height.
All these ways works properly in web browser, but not in Prince.. Is there any good solutions for this?
mikeday
No, not yet. Prince runs JavaScript before layout, so widths and heights are not available. This limits JavaScript to structural transformations, basically. We hope to change this in the future, but implementing full support for reflow is a huge undertaking.