Go API

Go API

The Go API gives you direct access to the boxes and glue typesetting engine. The documentation is still in its early state and subject to change — please expect API changes until boxes and glue hits version 1.

Looking for something simpler? If you just want to render HTML/CSS to PDF, see bagme — it wraps the engine in a simple, high-level API.

Architecture overview

How the library is structured — frontend vs. backend, the node system, and how the pieces fit together.

First document

Start with an empty directory and finish with a one page PDF file with text broken into lines.

The frontend library

The high-level API for loading fonts, creating text, and placing content on pages.

The backend library

The low-level API for direct node manipulation and full control over every detail of the PDF output.