No headless browser
The native library is linked into your Go binary. No Chromium in your container image, no Gotenberg service next to it.
In Go, PDF generation usually means headless Chrome, driven through chromedp or running in a Gotenberg service, or drawing every table and page break yourself with a low-level library. The first adds a browser to your deployment, the second buries the document design in code.
Oicana compiles PDFs in process through a statically linked native library instead. Install with go get go.oicana.com/oicana, load a packed template once, and compile documents from JSON:
templateBytes, err := os.ReadFile("invoice-0.1.0.zip")if err != nil { return err}template, err := oicana.NewTemplate(templateBytes)if err != nil { return err}defer template.Close()
pdf, err := template.ExportPdf(oicana.Inputs{ JSON: map[string]any{ "invoice": map[string]any{ "number": "2026-001", "customer": "Acme GmbH", "total": "€1,190.00", }, },})A warmed up template produces a typeset 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:
[package]name = "invoice"version = "0.1.0"entrypoint = "main.typ"
[tool.oicana]manifest_version = 1
[[tool.oicana.inputs]]type = "json"key = "invoice"development = "invoice.json"The development value points at a JSON file in the template that stands in for real data while you design the template. It is also what the warm-up compilation during registration uses by default.
{ "number": "2026-42", "customer": "Acme GmbH", "total": "€42.00"}#import "@preview/oicana:0.2.1": 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.
Load the template once at startup and share it across handlers. net/http serves every request in its own goroutine, and a Template is safe for concurrent use. Compilations of the same instance serialize internally, so for more concurrency under heavy load, create several Template instances from the same template file.
The module links the native library through cgo, so builds need a C toolchain. go run go.oicana.com/oicana/cmd/oicana-install downloads the library for your platform, verifies its checksum, and prints the CGO_LDFLAGS that link it into your binary.
The net/http example project shows a complete service.
No headless browser
The native library is linked into your Go binary. No Chromium in your container image, no Gotenberg service next to it.
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.