Finally got it to work
check this beauty out:
https://anvil.works/build#clone:6FBGNTPHWXFPXMVM=VINOWOPWVQKKHTFAV5Z6UUKR
Needless to say that this is the effort of the very supportive Anvil community.
It works actually pretty simple.
The pdf template is wrapped into a repeating panel.
The item of the repeating panel is a custom form which has the pdf tempate in a column panel and a page wrapper below it.
Thanks again for your help @robert, @robert, @Agobin, @Tony.Nguyen!