Use user input to create Document Templates for pdf export

0
I am working on an application that needs to export pdfs in different formats (Text at different locations, different custom sizes etc.) The best solution would be to let the users build their pdf-template themselves. However the Document Templates are no entities and I dont find a way of customizing them at runtime. I want the users to be able to specify text fonts and the position of text boxes.   Right now I have static Document-Templates and an Enum which links to these templates (used in if expressions in getDocument microflow) so that the user can input which template should be used.   Also related: Since Templates are no entities, you can not pass them e.g. as variables to the "Generate Document"-Block in Microflows but you have to hard-code them for each different template (image shows Screenshot of “Generate Document”-Block) That is just not pretty from a Software-Architecture point of view.    Any help would be appreciated.
asked
1 answers
1

We created our own interface with column entities etc which can be created and edited by the end user with ckeditor. Then we combine the input and build html and put that into a mendix template that only uses this as xhtml and creates a pdf out of it. It’s a lot of work to create this interface (especially if you want to be able to add images etc) and the java library that Mendix uses to create the pdf is ancient and doesn’t support all css.

 

Another approach would be to try modules like this one or this one.

 

And Mendix 10 has improved (?) pdf generation, but I haven’t seen or tried it yet. Also it’s a bit early to use Mx 10 for production apps.

answered