How to create a PDF template

To use Flowmailer to create a PDF, you can follow these steps:

  1. From the dashboard, go to Design > Templates;

  2. Click "Create template";
  3. Select Type "XHTML to PDF";
  4. Create a template for the PDF document. A template is an HTML file that contains placeholders for dynamic data. You can use Freemarker syntax to insert the placeholders into the template;

  5. Set up the data model for the template. The data model is a Java object that contains the data that will be used to fill in the placeholders in the template;

  6. Flowmailer will process the template and generate the PDF when applied to a Flow. To do this, you will need to add the template as a Flowstep in a Flow;

Here's an example of a template for a PDF document:

<!DOCTYPE html>
<HTML>
<head>
<title>My PDF Document</title>
<style>/* CSS styles go here */</style>
</head>
<body>
<h1>${title}</h1>
<p>${content}</p>
</body>
</html>

In this example, ${title} and ${content} are placeholders for dynamic data that will be filled in when the template is processed.