I am currently building a resume editor and am desperate. I have tried all possible ideas but none have worked. Can you help me with my following problem.
I have two repeating groups, “work experience” and “education”. Which is currently on the first page. If both do not fit on the first page, the repeating group “education” is moved to the second page. This is how it currently looks:
However, I would like the repeating group “education” to be split. All items that fit on the first page should be displayed there and the rest on the second page. This is how it should look in the end:
I would like to generate the PDF afterwards. To do this, it must already be displayed correctly. It should be a “preview”, where the data is used directly from the database. If the user makes changes, they are displayed directly in the “preview” and a pdf does not have to be generated beforehand. This makes the website faster and a pdf is not saved for each user. I forgot to mention this in the post.
PDF creation can be a pain. Looking forward too seeing what PDFPotion can do
If you want to display your preview on the page, you will not be able to get it done with one repeating group unless you inject an unruly amount of CSS and some javascript.
You will have to use two RGs. One on the top page and one on the bottom page.
Elements now expose their height values, and you can use them to determine whether elements will snap or fit in their parent (or a fixed height).
At a high level, you will need to evaluate whether the sum of the heights of the groups is greater than the height of the page. If it is, then you will move over the last cell of the first Education RG into the second Education RG (either using regex or list operators). Then you’ll have to re-check whether the elements now fit on the first page, and loop through the process until you’ve moved enough text away from the first page and the elements end up fitting.
You will not get this working with conditionals, because conditionals continuously re-evaluate and will end up in an infinite loop. You will have to use custom events and custom states. Take care with race conditions.
The above method also works in the situation where even just the Work Experience RG doesnt fit on the first page.