I have text content with over 50,000 words. I have to separate it page by page in A4 size but the text is overflowing after the 1st page. I need to preview the HTML content (on browser, before printing) on A4 page. Issue is that I am unable to keep track of the page height. So, when page ended, some of the content goes outside the page.
Is there some way I can render dynamic HTML content on A4 pages?
You can do this with css, like below:
See also https://developer.mozilla.org/en-US/docs/Web/CSS/@page .
For closer control, use the
break-insideCSS property; see https://developer.mozilla.org/en-US/docs/Web/CSS/break-inside