No headless browser
JNI bindings compile PDFs on the JVM. No browser process next to your service, no document rendering over HTTP.
On the JVM, PDF generation usually means low-level libraries where every table and page break is layout code, or rendering HTML in a headless browser next to your service. One buries the document design in Java, the other adds a heavy runtime dependency.
Oicana compiles PDFs in process through a native JNI interface instead. Add the com.oicana:oicana Maven package plus the native artifact for your platform, load a packed template once, and compile documents from JSON:
import com.oicana.Template;import java.nio.file.Files;import java.nio.file.Path;import java.util.Map;
byte[] templateBytes = Files.readAllBytes(Path.of("invoice-0.1.0.zip"));try (var template = new Template(templateBytes)) { byte[] pdf = template.export( Map.of("invoice", """ { "number": "2026-001", "customer": "Acme GmbH", "total": "€1,190.00" } """), Map.of());}A warmed up template produces a print-ready PDF in single digit milliseconds, directly in your service.
The snippet loads invoice-0.1.0.zip, a packed Oicana template. Templates are plain Typst projects: a typst.toml manifest declares a JSON input named invoice, and main.typ uses it:
#import "@preview/oicana:0.2.0": setup
#let read-project-file(path) = read(path, encoding: none)#let (input, oicana-image, oicana-config) = setup(read-project-file)
#set document(date: datetime.today())
= Invoice #input.invoice.number
Billed to: #input.invoice.customer
*Total: #input.invoice.total*Running oicana pack in the template directory produces the zip. Create a Template walks through the manifest and input definitions, and the open source example templates include a complete invoice.
The Template instance is thread-safe and can be shared across requests, which fits Spring Boot’s singleton service scope naturally. Next to the main com.oicana:oicana package you add a native runtime artifact per target platform; you can declare several, and the matching one is loaded at runtime.
The Spring Boot example project shows a complete service.
No headless browser
JNI bindings compile PDFs on the JVM. No browser process next to your service, no document rendering over HTTP.
Your data stays with you
Documents are generated inside your own service. No customer data is sent to a third party, which keeps GDPR and HIPAA compliance in your hands.
Flat price, unlimited documents
One flat license per application, no metering. A hundred invoices a month cost the same as a hundred thousand. Non-commercial use is free.