I'm looking to implement a feature that automatically breaks or paginates HTML content in order to ensure that the resulting PDF matches the appearance of the original HTML.
Requirement: If HTML content exceeds the size of an A4 paper, it should be split onto a new page.
Question: How can I achieve pagination when content surpasses the dimensions of an A4 paper by utilizing a Vue plugin like vue-html2pdf?
Steps to Reproduce:
Clicking on the 'Auto add textcontent' button will generate multiple text lines and pages, but pagination is not functioning properly;
Clicking on the 'Generate pdf' button successfully generates a PDF with proper pagination. Is there a way to enable automatic pagination without having to actually generate the PDF?
To view what I have attempted so far, please visit this Codesandbox link