Skip to content

kolinsky

HTML and CSS to PDF, in Rust, in milliseconds.

Install

cargo add kolinsky
pip install kolinsky
v=$(curl -fsSL https://kolinsky.spenhouet.com/releases/latest.json | sed -n 's/.*"version": "\([^"]*\)".*/\1/p') && curl -fsSL "https://kolinsky.spenhouet.com/releases/v$v/kolinsky-$v-x86_64-unknown-linux-gnu.tar.gz" | tar xz && sudo mv "kolinsky-$v-x86_64-unknown-linux-gnu/kolinsky" /usr/local/bin/
v=$(curl -fsSL https://kolinsky.spenhouet.com/releases/latest.json | sed -n 's/.*"version": "\([^"]*\)".*/\1/p') && curl -fsSL "https://kolinsky.spenhouet.com/releases/v$v/kolinsky-$v-aarch64-unknown-linux-gnu.tar.gz" | tar xz && sudo mv "kolinsky-$v-aarch64-unknown-linux-gnu/kolinsky" /usr/local/bin/
v=$(curl -fsSL https://kolinsky.spenhouet.com/releases/latest.json | sed -n 's/.*"version": "\([^"]*\)".*/\1/p') && curl -fsSL "https://kolinsky.spenhouet.com/releases/v$v/kolinsky-$v-aarch64-apple-darwin.tar.gz" | tar xz && sudo mv "kolinsky-$v-aarch64-apple-darwin/kolinsky" /usr/local/bin/
v=$(curl -fsSL https://kolinsky.spenhouet.com/releases/latest.json | sed -n 's/.*"version": "\([^"]*\)".*/\1/p') && curl -fsSL "https://kolinsky.spenhouet.com/releases/v$v/kolinsky-$v-x86_64-apple-darwin.tar.gz" | tar xz && sudo mv "kolinsky-$v-x86_64-apple-darwin/kolinsky" /usr/local/bin/
$v = (irm https://kolinsky.spenhouet.com/releases/latest.json).version; irm "https://kolinsky.spenhouet.com/releases/v$v/kolinsky-$v-x86_64-pc-windows-msvc.zip" -OutFile kolinsky.zip; Expand-Archive kolinsky.zip -DestinationPath .

From HTML to PDF

use kolinsky::{Engine, Input, PdfOptions, RenderOptions};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let engine = Engine::new();
    let input = Input::Path("hello.html".into());
    let rendered = engine.render(input, &RenderOptions::default(), &PdfOptions::default())?;
    for d in &rendered.diagnostics {
        eprintln!("{}: {}", d.code, d.message);
    }
    std::fs::write("hello.pdf", rendered.output)?;
    Ok(())
}
kolinsky render hello.html -o hello.pdf
from pathlib import Path

import kolinsky

result = kolinsky.render(Path("hello.html"))
for d in result.diagnostics:
    print(f"{d.code}: {d.message}")
Path("hello.pdf").write_bytes(result.pdf)
hello.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Invoice 2026-042</title>
<style>
  @page {
    size: A6 landscape;
    margin: 12mm 12mm 14mm;
    @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 7pt sans-serif; color: #777 }
  }
  body { font: 9pt/1.4 sans-serif; color: #222 }
  header { display: flex; justify-content: space-between; align-items: baseline;
           border-bottom: 2px solid #c25129; margin-bottom: 4mm }
  h1 { font-size: 16pt; margin: 0; color: #c25129 }
  table { width: 100%; border-collapse: collapse }
  th, td { padding: 1.2mm 2mm; border-bottom: 0.5pt solid #ddd; text-align: left }
  td:last-child, th:last-child { text-align: right }
  tfoot td { font-weight: bold; border-bottom: none }
</style>
</head>
<body>
  <header><h1>Invoice</h1><span>No. 2026-042</span></header>
  <table>
    <thead><tr><th>Item</th><th>Hours</th><th>Amount</th></tr></thead>
    <tbody>
      <tr><td>Layout review</td><td>4</td><td>€ 480.00</td></tr>
      <tr><td>Print stylesheet</td><td>6</td><td>€ 720.00</td></tr>
      <tr><td>PDF/UA check</td><td>2</td><td>€ 240.00</td></tr>
    </tbody>
    <tfoot><tr><td>Total</td><td></td><td>€ 1,440.00</td></tr></tfoot>
  </table>
</body>
</html>

The first page of hello.pdf, rendered by kolinsky

The image is the PDF that these lines write, rasterized; the docs build renders it with kolinsky every time.

Speed

Wall time per document, from process start to the PDF written, on a log scale. Shorter is faster.

Wall time per document and engine, milliseconds, log scale kolinsky WeasyPrint Chromium wkhtmltopdf Typst 1 ms 10 ms 100 ms 1 s 10 s 100 s invoice-10 kolinsky, invoice-10: 9.0 ms 9.0 ms WeasyPrint, invoice-10: 624 ms Chromium, invoice-10: 784 ms wkhtmltopdf, invoice-10: 297 ms Typst, invoice-10: 160 ms invoice-100 kolinsky, invoice-100: 16 ms 16 ms WeasyPrint, invoice-100: 1,038 ms Chromium, invoice-100: 936 ms wkhtmltopdf, invoice-100: 319 ms Typst, invoice-100: 264 ms invoice-1000 kolinsky, invoice-1000: 123 ms 123 ms WeasyPrint, invoice-1000: 5,848 ms Chromium, invoice-1000: 1,872 ms wkhtmltopdf, invoice-1000: 571 ms Typst, invoice-1000: 1,063 ms columns kolinsky, columns: 12 ms 12 ms WeasyPrint, columns: 1,076 ms Chromium, columns: 819 ms wkhtmltopdf, columns: 316 ms Typst: n/a doc kolinsky, doc: 119 ms 119 ms WeasyPrint, doc: 8,147 ms Chromium, doc: 2,472 ms wkhtmltopdf: failed Typst: n/a odyssey kolinsky, odyssey: 174 ms 174 ms WeasyPrint, odyssey: 12,558 ms Chromium, odyssey: 2,300 ms wkhtmltopdf, odyssey: 1,302 ms Typst: n/a html5 kolinsky, html5: 152 ms 152 ms WeasyPrint, html5: 20,092 ms Chromium, html5: 2,348 ms wkhtmltopdf, html5: 1,476 ms Typst: n/a json kolinsky, json: 209 ms 209 ms WeasyPrint, json: 7,609 ms Chromium, json: 7,179 ms wkhtmltopdf, json: 558 ms Typst: n/a jsonraw kolinsky, jsonraw: 41 ms 41 ms WeasyPrint, jsonraw: 1,808 ms Chromium, jsonraw: 856 ms wkhtmltopdf, jsonraw: 355 ms Typst: n/a large kolinsky, large: 426 ms 426 ms WeasyPrint, large: 70,712 ms Chromium, large: 15,956 ms wkhtmltopdf: failed Typst: n/a

Measured on 2026-11-12 on one machine (x86_64 12 CPUs), all engines with the same fonts.

Method and all numbers

Conformance

The share of tests passed: overall, in the web area (CSS and SVG reftests of the web-platform-tests) and in the PDF area (PDF feature and paged-media checks).

Conformance score per engine: overall, web area and PDF area overall web (CSS and SVG reftests) PDF checks 0 % 25 % 50 % 75 % 100 % Chromium Chromium, overall: 55.7 % 55.7 % Chromium, web (CSS and SVG reftests): 69.6 % 69.6 % Chromium, PDF checks: 41.9 % 41.9 % kolinsky kolinsky, overall: 52.9 % 52.9 % kolinsky, web (CSS and SVG reftests): 41.2 % 41.2 % kolinsky, PDF checks: 64.6 % 64.6 % WeasyPrint WeasyPrint, overall: 52.2 % 52.2 % WeasyPrint, web (CSS and SVG reftests): 40.5 % 40.5 % WeasyPrint, PDF checks: 63.9 % 63.9 % wkhtmltopdf wkhtmltopdf, overall: 27.5 % 27.5 % wkhtmltopdf, web (CSS and SVG reftests): 37.9 % 37.9 % wkhtmltopdf, PDF checks: 17.0 % 17.0 %

Results of 2026-11-14, web-platform-tests commit 4c84956f8341.

Every engine, method and the scores per group

Features

  • Paged media: @page sizes and margins, the 16 margin boxes, page counters, named pages, running headers
  • Flexbox and grid: flex containers and CSS grid, also split across pages
  • Multi-column: columns with balancing, spanners and column rules
  • Floats and positioning: floats, absolute, fixed and relative positioning
  • Tables: fixed and automatic layout, collapsed borders, headers and footers repeated on every page
  • Fonts and complex scripts: @font-face with WOFF, OpenType features, Arabic, Indic, Thai and CJK shaping, bidirectional text, hyphenation
  • SVG and images: inline and external SVG, PNG, JPEG, GIF and WebP
  • Links and outline: internal and external links, PDF bookmarks from headings
  • PDF/A, PDF/UA and tagged PDF: PDF/A-2b, A-3u and A-4, PDF/UA-1 and UA-2, structure tags
  • Forms and attachments: HTML form controls drawn on the page, files embedded with --attach or by the document
  • Network off by default: documents load only local files unless you allow URLs
  • No system dependencies: one binary or wheel on Linux, macOS and Windows; fonts come from the system or your own folders