You are reading the documentation for an outdated Corteza release. 2023.9 is the latest stable Corteza release.


This is an experimental library.

This is not a Low Code extension, but a library.


The Renderer extension provides a way to render HTML and PDF files from HTML templates. You can use this to generate quotes or invoices, as well as emails and other messages.


To render a document, you must:
  1. provide an HTML template,

  2. provide the data.

The output is a Buffer object, that can be converted to a file, string, or uploaded to a server.

// Import renderer and template to automation script
import renderer from '@cortezaproject/corteza-ext-renderer'
import template from './template'

// Prepare data object
const data = {
  value: ''

// Render the report PDF
const { report, meta } = await renderer.render({ data, template, renderer: renderer.types.RendererKind.HTML })

// OR
const { report, meta } = await renderer.render({ data, template, renderer: renderer.types.RendererKind.PDF })

Template syntax

The template uses a simple HTML syntax.

Use this as a base:
<!DOCTYPE html>
      This is a HTML template example
      <br />
      <!-- you can use HTML comments if you wish -->
      Interpolate data like {{ }}

      <div data-for="(value, i) in this.arrayOf">
          You can loop through arrays.
        The <b>{{ this.value }}</b> is accessed like that.

      <div style="{{ this.classes }}">
        This also works.

  Styling is also supported.

  PDF documents will omit most of it; will be improved.

  HTML documents inline the styling.