No headless browser
Native bindings compile PDFs inside your .NET service. No browser process to deploy, no wkhtmltopdf wrapper to maintain.
In .NET, PDF generation usually means wrapping the abandoned wkhtmltopdf, running a headless browser next to your service, or writing every layout as code in a low-level library. All three make a simple invoice harder than it should be.
Oicana compiles PDFs in process through native bindings instead. Install with dotnet add package Oicana, load a packed template once, and compile documents from JSON:
using System.Text.Json.Nodes;using Oicana;using Oicana.Config;using Oicana.Inputs;
var template = new Template(File.ReadAllBytes("invoice-0.1.0.zip"));
var jsonInputs = new Dictionary<string, JsonNode>{ ["invoice"] = JsonNode.Parse( """{ "number": "2026-001", "customer": "Acme GmbH", "total": "€1,190.00" }""")!,};
var pdf = template.Export( jsonInputs, new Dictionary<string, BlobInput>(), ExportFormat.Pdf(), new CompilationOptions(CompilationMode.Production));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.
Template is safe to share across requests, so you can register it as a singleton in your dependency injection container. Compilations of one instance serialize internally; for more concurrency, create several Template instances from the same template file.
The ASP.NET example project shows a complete service.
No headless browser
Native bindings compile PDFs inside your .NET service. No browser process to deploy, no wkhtmltopdf wrapper to maintain.
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.