Build a standard Mendix page using the
DocumentLayout. You can use any Mendix standard or app store widgets and any styling when designing the page.
Declare a microflow that opens the page from step1.
Use the microflow action
Generate PDF to get a beautiful looking PDF file!
If you are having trouble check the sample usage which is included in the module or the troubleshooting guide on the right.
<aside> 📢 Having trouble generating a PDF? Error messages from Templator can give you important hints about what is going wrong. When testing use custom error handling and show the error message.
The microflow should only have either exactly zero or exactly one object parameter. Lists or variables such as String are not allowed. Also the object needs to be persistent.
Check that you have assigned the module role
Templator.User to the correct project role. The same user role needs rights to 1) execute the microflow that opens the page and 2) read access rights to the object parameter if one is being passed.
Are you getting an error that says
Did not expect an argument to be undefined ? Probably you forgot to give read access to the generated PDF file.
The following things could be causing a timeout when generating a PDF resulting in no PDF or a PDF with the wrong page, or an empty page:
The default Atlas theme is not compatible for printing to PDF due to the way the page is constructed in HTML. The best approach is to use the
DocumentLayout (provided in the module) for the page-to-print.
Page styling does not apply to the custom header/footer. Therefore all styling for the header/footer needs to be embedded in the header/footer HTML. The default font-size for the header/footer is very small so to see anything make sure to set the