This one is even better and in english: https://community.rei3.de/d/120-generate-dynamic-htmlpdf
Ekpu
Look in the community board. Link is in the bottom oft the page. There is a thread with an example. Ah I see. The better thread is in the german part here https://community.rei3.de/d/220-pdf-aus-formulardatensatz-erstellen
I hope with translation it is usable.
I had another idea. Maybe Dokuwiki with the struct and burocreacy Plugin would could work for you.
I am searching for a similiar Software. Ideal would be a low code database platform selfhostet with easy document generation. I am still searching but you can take a look at https://rei3.de/en/home. Low code and database works good. The document generation is a bit hacky but you can fill placeholders oft a HTML side. But they hinted that they will have to work in this because the library they used is no longer supportet. So I hope it will geht easier.
Plus side it comes with user management and some "apps" out oft the box and all oft the "apps" are interoperable. Self created apps are Versionen out oft the box and you have to sign them with a generated developer key which is also very nice.
I think for this it is over the top but I found rei3 one oft the best database webapp low-code builders: https://rei3.de/en/home