Jinja2PDF
Event ticket with QR code and PDF417
A print-at-home ticket on its own paper size, 210 × 80 mm without margins: a QR code for the check-in app on the stub, the ticket number again as a PDF417 strip for hand scanners, and the start time, doors and weekday formatted in German from two timestamps.
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
- The paper is
210mm×80mmwith zero margins, so the PDF is the ticket and nothing around it. barcode(ticket.id, { type: 'pdf417', height: 8 })andqrcode(ticket.check_in_url, { size: 120 })encode the same ticket for two kinds of scanner.date('EEEE, d. MMMM yyyy')anddate('HH:mm')turn two ISO timestamps intoDonnerstag, 12. November 2026, doors08:30and start09:30, in the template’s time zoneEurope/Berlin.- The stub is a 52 mm column beside the ticket, set off by a dashed line: plain CSS, no image of a ticket.
- Render it right after the purchase and attach the download to the confirmation mail.
Helpers used
Template folder
<main class="ticket">
<section class="main">
<p class="eyebrow">{{ event.series | upper }}</p>
<h1>{{ event.title }}</h1>
<p class="when">{{ event.starts | date('EEEE, d. MMMM yyyy') }} · Einlass {{ event.doors | date('HH:mm') }} Uhr · Beginn {{ event.starts | date('HH:mm') }} Uhr</p>
<p class="where">{{ event.venue }}, {{ event.address }}</p>
<dl>
<div><dt>Name</dt><dd>{{ holder.name }}</dd></div>
<div><dt>Kategorie</dt><dd>{{ ticket.category }}</dd></div>
<div><dt>Platz</dt><dd>{{ ticket.seat }}</dd></div>
<div><dt>Preis</dt><dd>{{ ticket.price | money }}</dd></div>
</dl>
<img class="strip" src="{{ barcode(ticket.id, { type: 'pdf417', height: 8 }) }}" alt="Ticketnummer">
</section>
<aside class="stub">
<img src="{{ qrcode(ticket.check_in_url, { size: 120 }) }}" alt="Check-in-Code">
<p>{{ ticket.id }}</p>
<p class="muted">Am Einlass vorzeigen</p>
</aside>
</main>body { margin: 0; font-family: 'Inter', sans-serif; color: #0f172a; }
.ticket { display: flex; height: 80mm; box-sizing: border-box; }
.main { flex: 1; padding: 9mm 10mm; background: linear-gradient(120deg, #eef2ff, #ffffff 60%); }
.eyebrow { margin: 0; font-size: 8pt; font-weight: 600; letter-spacing: 0.2em; color: #4f46e5; }
h1 { margin: 1.5mm 0 2mm; font-size: 20pt; line-height: 1.15; }
.when, .where { margin: 0; font-size: 9.5pt; color: #334155; }
dl { display: flex; gap: 9mm; margin: 5mm 0 4mm; }
dt { font-size: 7pt; letter-spacing: 0.05em; text-transform: uppercase; color: #64748b; }
dd { margin: 0.5mm 0 0; font-size: 10.5pt; font-weight: 600; }
.strip { display: block; height: 11mm; }
.stub { width: 52mm; padding: 9mm 6mm; box-sizing: border-box; border-left: 1.5px dashed #94a3b8; text-align: center; }
.stub img { width: 36mm; height: 36mm; }
.stub p { margin: 2mm 0 0; font-size: 9pt; font-weight: 600; }
.stub .muted { font-size: 7.5pt; font-weight: 400; color: #64748b; }<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap">{
"pdf": {
"metadata": {
"title": "{{ event.title }}"
}
},
"paper": {
"width": "210mm",
"height": "80mm"
},
"margin": {
"top": "0",
"right": "0",
"bottom": "0",
"left": "0"
},
"locale": "de-DE",
"timezone": "Europe/Berlin",
"currency": "EUR"
}{
"event": {
"series": "Fennlor Konferenz 2026",
"title": "Dokumente, die sich selbst schreiben",
"starts": "2026-11-12T09:30:00+01:00",
"doors": "2026-11-12T08:30:00+01:00",
"venue": "Stadthalle Musterstadt",
"address": "Musterstraße 1, 12345 Musterstadt"
},
"holder": {
"name": "Erika Mustermann"
},
"ticket": {
"id": "FK26-000193",
"category": "Konferenz + Workshop",
"seat": "Freie Platzwahl",
"price": 349,
"check_in_url": "https://konferenz.example/checkin/FK26-000193"
}
}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: "ticket", data: ., filename: "ticket-FK26-000193.pdf"}' 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: 'ticket',
data,
filename: 'ticket-FK26-000193.pdf',
});
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="ticket",
data=data,
filename="ticket-FK26-000193.pdf",
)
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' => 'ticket',
'data' => json_decode(file_get_contents('data.json'), true),
'filename' => 'ticket-FK26-000193.pdf',
]);
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: "ticket",
Data: data,
Filename: "ticket-FK26-000193.pdf",
})
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 = "ticket",
Data = JsonSerializer.Deserialize<Dictionary<string, object?>>(File.ReadAllText("data.json")),
Filename = "ticket-FK26-000193.pdf",
});
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("ticket")
.data(data)
.filename("ticket-FK26-000193.pdf");
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: "ticket",
data: JSON.parse(File.read("data.json")),
filename: "ticket-FK26-000193.pdf"
)
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.