https://notion-ga.ohwhos.now.sh/collect?tid=UA-65620077-1&host=gajd.uk&page=/templator/docs
The module is compatible with all supported Mendix versions. Find the right module version for you on the downloads page
Additional Options
can be passed when generating PDF to define margins, header/footer and more. Please refer to this document for an extensive list of all options https://github.com/puppeteer/puppeteer/blob/v2.1.0/docs/api.md#pagepdfoptions
Additional Mendix specific options:
HideControlElements
hides Mendix control elements such as buttons, paging etc, true by defaultHideDialogs
hides Mendix dialogs, true by defaultHideValidations
hides Mendix validation messages, true by defaultDisableBootstrapPrintStyling
disables all bootostrap print styling when generating the PDF. This styling interferes with colors and other CSS properties and results in a PDF that does not match the web page, true by defaultThe templator only works for apps that are publicly accessible i.e. have a public IP address. This is not the case when running locally. If you wish to test how a PDF will look like without having to deploy to the cloud there are two possibilities:
One option is to run locally and expose the microflow that you are trying to generate PDF from as a button on a page. Then open the latest Chrome browser, click on the button then press Ctrl + P
(or ⌘+P
if you are on Mac) and choose Destination: Save as PDF
. Since templator uses the same PDF engine as Chrome, the two PDFs should be identical provided that all the options are the same.
<aside> 💡 In newer versions of Templator this is handled automatically by the module.
</aside>
Alternatively, you can use a tool such as ngrok
or localtunnel
to expose your local 8080
port where Mendix applications run by default. If you decide to use this method you will need to set the constant ApplicationURLOverrideOPTIONAL
to your ngrok URL so that templator knows where to find your app.
ngrok
? (click for details)App access: In order to generate documents, the templator is given restricted and temporary access to the app for the specified user using a special token. This access is secured and limited to 60 seconds or until the PDF is generated whichever comes frist.
Request data: The templates themselves may contain sensitive or personal data that is sent over a network. All data sent over the network is sent via an SSL. On top of this, sensitive data e.g. access token is additionally encrypted using 2048bitRSA encryption.
Data storage: Any data that is part of the pdf, as well as the pdf itself, is not persisted at any point outside of the Mendix app. To administer rate limits (see below) templator stores the timestamp, the number of pages, project id, and app url for each request.
If data privacy is a concern for you, contact us for a docker-ized solution that you can deploy on your own infrastructure.
Most CSS styling is supported when generating PDF. However, there are some inconsistencies or strange behaviors when generating a PDF from HTML/CSS. An extended list of gotchas was compiled by Nathan at https://nathanfriend.io/2019/04/15/pdf-gotchas-with-headless-chrome.html
Additionally, below a list of selected things to keep in mind:
To promote fair use, templator sets rate and time limits.
Need more requests or pages? Contact me via the Mendix community Slack https://app.slack.com/client/TK3TS4MV0/DNLKSE7U6/user_profile/UKH7GPA1F
<aside> ⚠️ The rate and time limits are subject to change at any moment without notice.
</aside>
Templator uses Chrome version 82 to generate the PDF.
<aside> 📢 In an effort to give more value to free clients the watermark has been removed. Hooray 🎉🎉🎉 Rate limits still apply, though!
</aside>
When using Templator without a license key the generated PDF contain a watermark image. We offer promotional license keys to anyone willing to answer a few questions about the module and give use feedback on how to improve it. We are working on a portal where this can be done in a web form but for the time being you need to reach out to me via slack or email.
The module is free to use subject to the rate limitations defined above.
For feedback and questions reach out to me via the Mendix community Slack https://app.slack.com/client/TK3TS4MV0/DNLKSE7U6/user_profile/UKH7GPA1F