Jinja2PDF
One template, many languages
Texts come from the template’s dictionary through t(), and the request’s locale picks the language and the number and date formats. The German render says “Auftragsbestätigung” and 113,50 €, the English one “Order confirmation” and €113.50, from the same data.
Free plan, no card. You get your own copy in the editor, published and ready for the API.
Change a value, watch the document follow
This is Formfeed’s template engine, running in your browser. Nothing you type is sent or saved.
Loading the engine …

The document as the engine writes it, in pages as the API prints the PDF from it. Shown here on one sheet. The PDF breaks it into pages.
You get your own copy in the editor, with the example’s data. What you changed here stays on this page.
Rendered result
What this example shows
i18n.jsonholds one dictionary per language;t('title', { number: order.number })fills the{number}placeholder of the chosen one.- The request’s
localedecides everything at once: the dictionary,money(113,50 €or€113.50) and the long date thatdate('PPPP')prints. - The data is the same for every language, so the caller never sends translated strings or formatted numbers.
- Without
localein the request, the template’s own setting (en-GB) applies.
Helpers used
Template folder
<h1>{{ t('title', { number: order.number }) }}</h1>
<p>{{ t('thanks', { name: order.customer }) }}</p>
<table>
{% for item in order.items %}
<tr><td>{{ item.name }}</td><td class="num">{{ item.total | money }}</td></tr>
{% endfor %}
<tr class="grand">
<td>{{ t('total') }}</td>
<td class="num">{{ order.items | sum('total') | money }}</td>
</tr>
</table>
<p>{{ t('delivery') }}: {{ order.date | dateAdd(3, 'days') | date('PPPP') }}</p>body { font-family: 'Noto Sans', sans-serif; font-size: 10pt; color: #1e293b; }
h1 { margin: 0 0 3mm; font-size: 16pt; color: #312e81; }
table { width: 100%; margin: 7mm 0; border-collapse: collapse; }
td { padding: 2mm 0; border-bottom: 1px solid #e2e8f0; }
.num { text-align: right; }
.grand td { border-top: 1.5px solid #1e293b; border-bottom: 0; font-weight: 700; }{
"pdf": {
"metadata": {
"title": "{{ t('title', { number: order.number }) }}"
}
},
"paper": {
"format": "A5"
},
"margin": {
"top": "16mm",
"right": "14mm",
"bottom": "16mm",
"left": "14mm"
},
"locale": "en-GB",
"currency": "EUR"
}{
"en": {
"title": "Order confirmation {number}",
"thanks": "Thank you for your order, {name}.",
"total": "Total",
"delivery": "Expected delivery"
},
"de": {
"title": "Auftragsbestätigung {number}",
"thanks": "Vielen Dank für Ihre Bestellung, {name}.",
"total": "Gesamt",
"delivery": "Voraussichtliche Lieferung"
}
}{
"order": {
"number": "A-1042",
"customer": "Jane",
"date": "2026-09-10",
"items": [
{
"name": "Desk lamp",
"total": 89
},
{
"name": "Linen shade",
"total": 24.5
}
]
}
}Render it through the API
Save the sample data as data.json and send it with the template’s name. Each language uses its SDK; curl sends the same JSON to the REST API, as any other language can. Renders with a key that starts with ff_test_ are not metered; on the Free plan they carry a small watermark.
jq '{template: "order-confirmation", data: ., locale: "de-DE"}' data.json \
| curl https://api-eu.formfeed.dev/v1/renders \
-H "Authorization: Bearer ff_test_..." \
-H "Content-Type: application/json" \
--data-binary @-import { Formfeed } from '@formfeed/sdk';
import data from './data.json' with { type: 'json' };
const formfeed = new Formfeed({ apiKey: process.env.FORMFEED_API_KEY! });
const render = await formfeed.renders.create({
template: 'order-confirmation',
data,
locale: 'de-DE',
});
console.log(render.status, render.download_url);import json
import os
from formfeed import Formfeed
formfeed = Formfeed(api_key=os.environ["FORMFEED_API_KEY"])
with open("data.json", encoding="utf-8") as file:
data = json.load(file)
render = formfeed.renders.create(
template="order-confirmation",
data=data,
locale="de-DE",
)
print(render.status, render.download_url)<?php
require __DIR__ . '/vendor/autoload.php';
$formfeed = new Formfeed\Client(apiKey: getenv('FORMFEED_API_KEY'));
$render = $formfeed->renders->create([
'template' => 'order-confirmation',
'data' => json_decode(file_get_contents('data.json'), true),
'locale' => 'de-DE',
]);
echo $render->status, ' ', $render->downloadUrl, PHP_EOL;package main
import (
"context"
"encoding/json"
"fmt"
"log"
"os"
formfeed "github.com/formfeed-dev/formfeed-go"
)
func main() {
client := formfeed.NewClient(os.Getenv("FORMFEED_API_KEY"))
contents, err := os.ReadFile("data.json")
if err != nil {
log.Fatal(err)
}
var data map[string]any
if err := json.Unmarshal(contents, &data); err != nil {
log.Fatal(err)
}
render, err := client.Renders.Create(context.Background(), formfeed.RenderRequest{
Template: "order-confirmation",
Data: data,
Locale: "de-DE",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(render.Status, render.DownloadURL)
}using System.Text.Json;
using Formfeed;
using var formfeed = new FormfeedClient(Environment.GetEnvironmentVariable("FORMFEED_API_KEY"));
var render = await formfeed.Renders.CreateAsync(new RenderRequest
{
Template = "order-confirmation",
Data = JsonSerializer.Deserialize<Dictionary<string, object?>>(File.ReadAllText("data.json")),
Locale = "de-DE",
});
Console.WriteLine($"{render.Status} {render.DownloadUrl}");import com.fasterxml.jackson.databind.ObjectMapper;
import dev.formfeed.Formfeed;
import dev.formfeed.RenderRequest;
import java.io.File;
public class Render {
public static void main(String[] args) throws Exception {
var formfeed = Formfeed.builder().apiKey(System.getenv("FORMFEED_API_KEY")).build();
var data = new ObjectMapper().readTree(new File("data.json"));
var request = RenderRequest.template("order-confirmation")
.data(data)
.locale("de-DE");
var render = formfeed.renders().create(request);
System.out.println(render.getStatus() + " " + render.getDownloadUrl());
}
}require "json"
require "formfeed"
formfeed = Formfeed::Client.new(api_key: ENV.fetch("FORMFEED_API_KEY"))
render = formfeed.renders.create(
template: "order-confirmation",
data: JSON.parse(File.read("data.json")),
locale: "de-DE"
)
puts "#{render.status} #{render.download_url}"Start rendering today
The free plan includes 100 units a month and free test renders. Change plans when you need more.
