For the complete documentation index, see llms.txt. This page is also available as Markdown.

PDF templates

The PDF template class generates PDF documents by merging App data with layouts designed in the PDF Template Editor. Each template operates as an instance that contains the fillTemplate function for its layout. This class requires an instance. The code class name is PdfTemplate.

fillTemplate

Merges data with the pre-designed layout and generates a completed document.

Parameters

Input
Key
Description
Type

values

A data object containing key-value pairs. The keys must exactly match the variable names configured for placeholders in the PDF Template Editor (such as firstName or orderDate). Supports nested objects.

object

options

showEmptyVariables

Displays the variable name in angle brackets (such as <firstName>) for placeholders without a value. If false, leaves them empty. Default false.

boolean

Output

Returns the populated PDF document as a base64-encoded string. If rendering fails, the function returns nothing and the error appears in the log. During development, the function node displays a preview of the rendered PDF layout. Store the output in a database, display it in a media view widget, or send it as an email attachment.

The fillTemplate function node preview

Document generation

Each execution generates a new document and populates the entire template in a single operation. For templates with multiple fields, assemble the required data into a single structured object before passing it to the function.

Example

Fill template layout

Full tutorial

See the step-by-step tutorial to build a dynamic acceptance report from start to finish:

From Data to Document: Automating PDF Reports

Last updated

Was this helpful?