HTML field Auto Height Adjustment

23 October, 2025 14:06:03
LELF
Topics: 14
Messages: 75
Hello,

I have 2 html fields and I am unsure the height of each one, because I don't know how long the inventor notes will be. It is difficult to give it a specific height due to this and we want it to look nice. If it is shorter than shrink to fit the text size and if it is long and then expand, even if it means creating a new page.

So, is there a way auto adjust the height using CSS or JavaScript so it the field grows based on the number of words in the field. I know this is possible using CSS and JavaScript outside of E2PDF. Please let me know.

Thank you
23 October, 2025 14:09:12
LELF
Topics: 14
Messages: 75
Also, I don't want to auto fit the font, because if the notes are 1000 words then the font will be to small to read. I need the html field to adjust to the text length.

Thank you
23 October, 2025 14:18:42
E2Pdf
Support
Topics: 7
Messages: 3556
Hello,

Unfortunately, this is currently not possible, as all elements are using static and pre-defined positions at the moment.

The only possible approach is to place all content with dynamic sizing inside a single HTML object and use the feature that continues content onto new pages if it overflows.

However, for other elements, they should be placed either before the dynamic HTML block or on separate pages.

In our demo, you can see an example where dynamic content is properly split across pages: https://e2pdf.com/demo/wordpress

Please, see the screenshots attached.

Instead of using [e2pdf-wp key="post_content"], you should include all your content from the different HTML objects. For example:

<h1>Patient Information</h1>
<br>
<p>
{field:1}
</p>
<h1>Patient Information 2</h1>
<br>
<p>
{field:2}
</p>


We would really appreciate your feedback at WordPress.org!
23 October, 2025 14:27:19
LELF
Topics: 14
Messages: 75
Thank you, do you have plans to add this feature in the future?
23 October, 2025 14:29:10
E2Pdf
Support
Topics: 7
Messages: 3556
Yes, we are already working on a feature that will allow all elements to be relative to each other with dynamic sizes. However, due to the complexity of the task, we do not have an ETA yet.
We would really appreciate your feedback at WordPress.org!