Guide
A Button is type of Automations that is triggered manually.
There is an unlimited number of Actions you can execute using Buttons, including generating PDF files. This comes in handy when, for example, you want to generate and attach PDF invoices to Entities.
Please note that you need to have Files Field for this Action.
You can go with two options: either generate a PDF using Markdown Templates or using HTML template. The latter allows you to use custom CSS styles and rich HTML formatting, so your design is not limited by standard Markdown options.
Please keep in mind that Buttons are configured for each Database separately.
How to generate PDF file using Markdown template
Choose a Database.
Click Automations in the upper right corner.
In the opened window, click Button.
Go to Action and choose Attach PDF using template. You need to have Files Field in your Database for this Action.
Provide a markdown template for generating the document. Please find examples in Markdown Templates.
Save Button.
Go to an Entity in a chosen Database and execute Button to generate a PDF file.
How to generate custom designed PDF file using HTML template
Choose a Database.
Click Automations in the upper right corner.
In the opened window, click Button.
Go to Action and choose Attach PDF using template. You need to have Files field in your Database for this Action.
Provide an HTML page template for generating the document.
Tick Treat template as HTML page checkbox.
Save Button.
Go to an Entity in a chosen Database and execute Button to generate a PDF file.
Please note that Markdown is not processed in this case.
If you want to generate and send custom designed PDF files, please also check Generate and Send Custom Designed PDF Files.
How to generate PDF files for multiple Entities
If you want to generate PDF files for multiple Entities at a time, please create a View of a needed Database first.
This is applicable both for Markdown and HTML templates
Select all Entities using the checkbox in the left column.
Go to Actions and execute the needed Button.
Voila! You generated PDF files for multiple Entities.
How do I get examples of Markdown and HTML templates
For Markdown, please refer to Markdown Templates
For HTML templates, please refer to Lean HTML.
If nothing helps, drop us a line in support chat
FAQ
How do I travel through relations?
We support one level of hierarchy depth. For example {{Company.Name}}
For other cases we suggest creating a formula, and using formula result instead.
How can I ensure the PDF button only works when mandatory fields are filled?
It is possible. You will need to use JS to query the entity and check for valid data.
As an alternative, create a checkbox, and use the button to tick the box, and then have an automation rule (with necessary filters) that does the PDF generation.
And another automation (for the case where the filter conditions are not met) to generate an alert (and also to clear the checkbox).