openhtmltopdf
openhtmltopdf copied to clipboard
Find out computed element CSS style value
Hi,
Is there a way to know (hook, subscribe, listen) before rendering (Preflight) what would be the inherited CSS styles of a inner element and somehow make on-the-fly changes to the element? For instance would somehow be possible to know that the following img
inherits margin-left
from p
that will affect the maximum width I could set to the image in order to prevent it from going beyond the page right margin?
<style>
p { margin-left: 5pt}
@page{A4;margin:3cm 3cm 2cm 3cm}}
</style>
<body>
<p><img src="http://some URL" />
</p>
</body>
Best Regards, Sergio Fukaya