Works offline
PDFs are compiled on the device. No backend to build and operate, and no internet connection needed to create a document.
Flutter apps that need PDFs usually lay out every page in Dart code with a drawing library, or send the data to a backend that renders the document. The first buries the document design in code, the second needs a server and a connection.
Oicana compiles PDFs on the device instead. Add it with flutter pub add oicana, load a packed template once, and compile documents from JSON:
import 'package:flutter/services.dart';import 'package:oicana/oicana.dart';
final bytes = await rootBundle.load('templates/invoice-0.1.0.zip');final template = await Template.load(bytes.buffer.asUint8List());
final pdf = await template.exportPdf( jsonInputs: { 'invoice': { 'number': '2026-001', 'customer': 'Acme GmbH', 'total': '€1,190.00', }, },);A warmed up template produces a typeset PDF in milliseconds, without leaving the device.
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, for example when a page opens, and keep it around. On Android, iOS, and desktop, the methods without the Sync suffix run on a separate isolate, so the UI stays responsive while Oicana compiles. The first build for a native target downloads the native library for that target and bundles it with the app.
On the web, Oicana runs as WebAssembly on the UI thread. The browser deployment guide has more on serving it.
Plain Dart programs, like servers and command line tools, use the same API. Deploy them with dart build cli, which puts the native library next to the executable.
The Flutter example app shows live previews, blob inputs, schema validation, and saving files on desktop. The Dart example service serves PDFs over HTTP with shelf.
Works offline
PDFs are compiled on the device. No backend to build and operate, and no internet connection needed to create a document.
Your data stays with you
Documents are created on your users’ devices. No customer data is sent to a server, 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.