Blocpress – ODT to PDF Document Rendering Engine

ODT to PDF Document Rendering Engine

Turn LibreOffice Writer templates into PDF, RTF, or ODT via a single HTTP call — self-hosted, open source, Docker-ready.

blocpress — render
# Generate a PDF from an ODT template
$ curl -X POST \
    http://localhost:8080/api/render/template \
    -H "Accept: application/pdf" \
    -F "template=@invoice.odt" \
    -F "data=@invoice.json" \
    -o invoice.pdf

✓  invoice.pdf  (52 KB)  200 OK
✓ Open Source ✓ Self-hosted ✓ Docker ✓ Java 21 ✓ MIT License ✓ Elasticsearch Search ✓ Compliance Lifecycle ✓ No Vendor Lock-in

Blocpress is a free, self-hosted document generation service that turns LibreOffice Writer templates (ODT) into production-ready PDF, RTF, or ODT documents — fully automated via a simple HTTP API.

Designed for enterprise document workflows, Blocpress is ideal for generating contracts, invoices, letters, and reports from structured JSON data. Templates are authored in LibreOffice Writer using standard User Fields, conditional sections, and repeat groups — no proprietary markup language required.

The server runs as a Docker container and exposes a clean OpenAPI/REST interface. A built-in template workbench lets template designers upload, validate, and approve templates through a browser-based UI with a full review workflow — including Elasticsearch-powered full-text search across all templates and building blocks.

From v2.3, Blocpress includes a compliance lifecycle for templates: configurable validity periods, automatic expiry blocking in the render service, a daily review scheduler, and a dedicated Retired status that removes templates from production cleanly.

ODT → PDF / RTF

Render LibreOffice ODT templates into production-ready PDF or RTF documents using headless LibreOffice — no proprietary rendering engine.

REST API

Generate documents via POST /api/render/template. No authentication required for stateless rendering — just send your template and JSON data.

Template Workbench

Browser-based UI for template designers: upload ODT templates, run validation, manage test datasets, run regression tests, and publish approved templates to production via a four-eyes review workflow.

LibreOffice Templates

Use standard LibreOffice Writer to author templates. Fields, conditional sections, and repeat groups map directly to JSON data — no custom syntax to learn.

Full-Text Search

Elasticsearch-powered search across all templates and building blocks — searches names, field names, conditions, and extracted ODT text. Fuzzy matching and highlighted results included.

Compliance Lifecycle

Configurable validity periods with automatic expiry enforcement in the render service. Daily review scheduler alerts on expiring templates. Clean Retire workflow removes templates from production.

Docker Ready

All-in-one Quickstart image bundles Studio, Workbench, Render, PostgreSQL, and Elasticsearch in a single container. Start the full stack with one docker run command — no cloud dependency.

Open Source

Free to use, self-hosted, and fully open source under MIT license. No vendor lock-in, no usage fees, no data leaves your infrastructure.

Quickstart

Start the server, download a sample template with matching JSON data, and generate your first PDF in three steps — no configuration required.

1. Run the container

docker run -d -p 8080:8080 -p 8081:8081 --name blocpress flaechsig/blocpress-studio-quickstart:latest

The Quickstart image bundles Studio (workbench UI on port 8080), Render (REST API on port 8081), PostgreSQL, and Elasticsearch in a single container. A built-in dev JWT keypair is included — override via -e MP_JWT_VERIFY_PUBLICKEY="..." and -e MP_JWT_VERIFY_ISSUER="..." for production use. Open http://localhost:8080 for the workbench UI.

2. Download a sample

Welcome Letter

Simple template with field replacement.

welcome.odt welcome.json

Invoice

Template with loops and calculated fields.

invoice.odt invoice.json

3. Generate a PDF

curl -X POST http://localhost:8081/api/render/template \ 
  -H "Accept: application/pdf" \ 
  -F "template=@welcome.odt" \ 
  -F "data=@welcome.json" \ 
  -o welcome.pdf 
  1. Stateless render endpoint on port 8081 — no authentication required
  2. Desired output format (application/pdf, application/rtf, or application/vnd.oasis.opendocument.text)
  3. ODT template file — see the README for authoring details
  4. JSON data file with template values
  5. Save generated document to file

Tutorials

Step-by-step guides for your first 10 minutes with Blocpress — pick your role:

📄

Template Designer

Learn how to create an ODT template in LibreOffice, upload it to the Workbench, add test data, run regression tests, and submit it for approval — in about 10 minutes.

Open Tutorial →
🛠

Sysadmin

Deploy Blocpress with Docker Compose, configure PostgreSQL and JWT authentication, set up a reverse proxy, and approve your first template into production — in about 10 minutes.

Open Tutorial →

How It Works

Blocpress processes ODT templates through a four-stage merge pipeline:

  1. Text block expansion — External ODT sections referenced via text:section-source are inlined, enabling reusable content blocks (e.g. terms & conditions).
  2. Condition evaluation — Conditional sections and fields are resolved against your JSON data using JEXL expressions.
  3. Loop handling — Sections and table rows containing array fields are duplicated per array element automatically.
  4. Field replacement — LibreOffice User Fields with dot-notation names (e.g. customer.name) are replaced with values from your JSON payload.

The merged document is then passed to headless LibreOffice for export to PDF or RTF. The entire process is stateless — no data is stored between requests.

Technology Stack