PDF Templates

PDF Templates are used within the DataEngine to generate PDF files for specific modules that can be downloaded or sent. For a DataEngine module, multiple templates can be configured with different contents and purposes. Within the template, data from the module as well as data from related modules can be used. Simplified conditions can be used to control how a PDF file is structured.

Module Setup

To utilize the PDF Template function, the module must be set up accordingly. Follow these steps:

  1. Go to the Admin area and select “Developer Tools” > “Dropdown Editor”.
  2. Edit the dropdown with the name ‘pdf_template_type_dom’.
  3. Enter the desired module name in the ‘Item Name’ field, e.g., core_Deals.
  4. Enter the name under which the module should appear in the selection in the ‘Display Label’ field, e.g., Deals.
  5. Click the ‘Add’ button to add as many modules as needed.
  6. Save the changes by clicking the ‘Save’ button.

Now, PDF Templates can be created for the configured modules.

Template Sections

A PDF Template consists of various sections:

  • Body: This section is generated and distributed over multiple pages if it doesn’t fit on one page.
  • Header: This section is repeated on every page of the generated PDF if there are multiple pages.
  • Footer: This section is repeated on every page of the generated PDF if there are multiple pages.

Template Variables

Variables can be used in the editor, having the form ‘$module_field’. The editor displays all possible variables for selection during setup.

Additionally, it is possible to add a post-processor to the template variable by using the “|” symbol. Currently, two post-processors are available:

  1. number(seperator;thousand;decimal): This post-processor formats the value as a number and allows for the specification of thousand separators and decimal points. For example, $module_field|number(,;.;2) formats the value as a number with 2 decimal places in the German format (2.314,65).
  2. date(format): This post-processor formats the value as a date according to the specified format. For example, $module_field|date(m/d/y) formats the value as a date in the format MM/DD/YY (04/19/2024). The format used internally is based on the PHP date formats as described in the PHP date format documentation.

Template Conditions

PDF Templates support a simplified condition syntax. This can be used to hide specific sections in the generated PDF. For example, a Deal Report could display different information depending on the Sales Stage.

Here are some examples of the condition syntax:

Simple Case:

{% if $variable == 'test' %}
    Display this part
{% endif %}

Case with ‘else’:

{% if $variable == 'test' %}
    Display this part
{% else %}
    Otherwise, display this part
{% endif %}

Conditions can be used in the Header, Footer, and Body Templates. Currently, only the ‘==’ operator is supported. All variables from the PDF Template Editor can be used. Please note that conditions cannot be nested at the moment.

Marini Systems GmbH | Contact SupportMarini Website | Privacy Statement | Legal