How to push products between print pages in document



I have a print container under document and list of print pages under each print container. I can add N number of products in each print page. In preview page there will be only one page. The products added in the edit page should fit in single page. If the products can not fit in the single page then those products should be moved into the next print page in the container. The products moved to next print page should fit in the preview page else the extra products should push to the next print page automatically. This should be followed for all the print pages under the print container.

Please provide a solution to achieve this functionality.



print pages do not need to reflect 1:1 actual paper pages. They can contain content for multiple pages, e.g. all content that belogs somehow together.
The actual calculation what fits on one paper page and where page breaks are needed is done by the pdf renderer during pdf rendering time.

So for your use case just use one print page and the products will be moved to next paper pages automatically while rendering the pdfs.