Installation

https://notion-ga.ohwhos.now.sh/collect?tid=UA-65620077-1&host=gajd.uk&page=/templator/quickstart

  1. Download the module from the downloads page
  2. Import the module in your Mendix project (help?)

Generate PDF

  1. 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.

  2. Declare a microflow that opens the page from step1.

  3. Use the microflow action Generate PDF to get a beautiful looking PDF file!

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/113c35e0-b60c-4a5b-b7f4-f414ccd8ce7e/Untitled.png

If you are having trouble check the sample usage which is included in the module or the troubleshooting guide on the right.

Step-by-step video tutorial:

https://www.youtube.com/watch?v=rARB6R4oWnE

Troubleshooting

<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.

</aside>

Invalid microflow/parameter

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.

Security/No access

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.

Timeouts/wrong or no page being shown

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:

Page cut in half/Scrollbar is visible

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.

Options header/footer

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 font-size. https://github.com/puppeteer/puppeteer/issues/5345#issuecomment-613023667