Skip to content

Oicana vs PDF Libraries

PDF libraries let you construct PDF documents programmatically by calling API methods to draw text, shapes, and images on a page. Popular libraries include iText (Java/.NET), PDFKit (Node.js), FPDF/TCPDF (PHP), ReportLab (Python), and Apache PDFBox (Java).

This approach gives you full control over every pixel, but comes at a cost.

With a PDF library, you typically write code like this:

  1. Create a document object
  2. Add pages and set dimensions
  3. Position text, images, tables, and shapes using coordinates or a layout API
  4. Write the resulting bytes to a file or response stream

The template is the code. There is no separate template file.

Since the layout is defined in application code, changing a template means changing, testing, and redeploying your application. Designers and non-developers cannot edit templates without developer involvement.

With Oicana, templates are standalone Typst files. They can be edited, previewed, and tested independently of the application.

An iText template written in Java cannot be reused in a Node.js service. If your organization uses multiple languages, you end up maintaining separate PDF generation code for each stack.

Oicana templates are language-agnostic. The same template works with the Java, C#, Node.js, Rust, Python, PHP, and browser integrations.

Positioning elements with coordinates or building table layouts through API calls is time-consuming and error-prone. Simple changes like adjusting spacing often require recompiling and inspecting the output.

Typst provides a high-level markup language with good layout control, reusable components, and a package ecosystem. You can build and reuse different layouts or rely on existing ones.

Most PDF libraries require you to run your code to see the output. There is no live preview during development, which slows down the design iteration cycle.

Oicana templates can be previewed in any Typst editor, giving you instant feedback.

When PDF libraries might still be the right choice

Section titled “When PDF libraries might still be the right choice”

You might need them if you have to manipulate existing PDFs (merge, split, annotate, fill forms). There are other options though and you could still use a Typst based tool for the document generation.

PDF LibrariesOicana
Template formatApplication codeTypst markup files
Editable by designersNoYes
Cross-language reuseNoYes
Live previewNoYes
Layout approachCoordinates / API callsDeclarative markup
Learning curveLibrary API + PDF specTypst markup