Template auto calculate height avoid breaks

I create a new elegant invoice template for invoiceplane and I will it publish soon.
I have the following issue - question how I can avoid to break invoice if I have many products any idea
I mean if i have 4-5 rows its fine but if is more then break and have most of them in first page and some in second page

Invoice templates are meant to be converted to PDF files which only work with pages. If you develop a template please make sure it is working for as many items as the user want.