I'm including jQuery 1.8.3 in my document and iterate over some img elements. However, when I call $(this).width(), Prince gives me an error: error: TypeError: value is not an object. If I call .offsetWidth directly on an element (without using jQuery), I get "undefined".
Is getting (and setting) width not supported by Prince yet?
Right, at the moment Prince runs JavaScript before typesetting, not after, so element positions and sizes are not available. We hope to fix this in the future for browser compatibility, but it will be a big change.
The only way is to use the multi-pass process, which allows you to typeset the document and then measure box positions after typesetting in order to modify the style and typeset again. However the API for doing this is different to the browser DOM properties.
Hi, coincidentally I was looking to use clientWidth property 1 day later than the last comment here, (to get the width of a variable element, so to dynamically set matching width for another decorative element). I assume my answer would be the same as above? And what would be the multipass api equivalent of clientWidth?