# krilla

> A high-level, ergonomic Rust library for creating PDF documents.

Source: https://talira.ai/catalog/krilla-ac5vwb68
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [documents / pdf / generation](https://talira.ai/categories/documents/pdf/generation), [languages / rust](https://talira.ai/categories/languages/rust)
- Licence: MIT OR Apache-2.0[^1][^2]
- Pricing: Free and open source[^1][^2]
- Free tier: yes[^1][^2]
- Self-hostable: yes[^2]
- Creator: Laurenz Stampfl (LaurenzV)

krilla is a Rust crate for creating PDF files from high-level drawing primitives: fills, strokes, gradients, masks, clip paths, blend modes, glyphs and images. It's built on [pdf-writer](https://talira.ai/catalog/pdf-writer-1hvagsht.md) and handles fonts itself, with OpenType and colour font support, a simple text API that shapes text with [HarfRust](https://talira.ai/catalog/harfrust-5n8vcc2s.md), and font subsetting with the [subsetter](https://talira.ai/catalog/subsetter-5mg54ff0.md) crate. It also writes outlines, page labels, links and annotations, metadata and tagged PDF, targets PDF 1.4 to 2.0, and can export to validated PDF/A-1 to PDF/A-4 and PDF/UA-1. It's meant for libraries that already have laid-out content (from HTML or their own layout engine), and is tested against snapshot tests, veraPDF and six PDF viewers; `krilla-svg` converts SVG to PDF.

## Links

- GitHub: https://github.com/LaurenzV/krilla
- Docs: https://docs.rs/krilla

## Problems it solves

- turn my Rust layout engine's output into a PDF without writing raw PDF objects
- draw paths, gradients and images onto PDF pages from Rust with a 2D graphics style API
- export PDF/A or PDF/UA compliant files from a Rust application
- generate tagged, accessible PDFs from Rust
- put text in any OpenType font, including colour emoji fonts, into a PDF and have it subset automatically
- convert SVG graphics to vector PDF content in Rust
- make PDF generation faster with multithreaded compression of pages and images
- add bookmarks, page labels and links to PDFs generated in Rust
- a PDF backend that renders the same way in Acrobat, Chrome, Preview and other viewers
- embed pages from an existing PDF into a new one I'm drawing in Rust

## Features

- fills, strokes, affine transforms, alpha and luminosity masks, clip paths and blend modes
- high-level text API (shaping with HarfRust) and a low-level positioned-glyph API
- OpenType fonts of all major flavours, including colour fonts
- font subsetting for CFF and TrueType fonts
- linear, radial and sweep gradients and patterns
- bitmap images (PNG, JPEG, GIF, WebP) and SVG via krilla-svg
- outlines, page labels, annotations, links and named destinations, metadata
- tagged PDF for accessibility
- PDF versions 1.4 to 2.0 and validated PDF/A-1 to PDF/A-4 and PDF/UA-1 export
- embedding pages from other PDF documents (pdf feature)
- optional multithreading with rayon
- snapshot, veraPDF and multi-viewer visual regression tests; no unsafe code

## Limitations

- Doesn't lay out text, build tables, break pages or add headers and footers: it draws content you have already laid out[^1]
- Doesn't encrypt PDFs or add digital signatures: out of scope for now, like many other PDF features[^1]

## Capabilities

- Has official SDKs: plan not known

## Trust

Overall: 0.23 out of 1.
Signals: backing 0.20, extensibility 0.00.

- created by Laurenz Stampfl (LaurenzV)

Warnings:

- GitHub activity not fetched yet

## Related

- Based on [pdf-writer](https://talira.ai/catalog/pdf-writer-1hvagsht.md)
- Based on [Skrifa](https://talira.ai/catalog/skrifa-aj7qcsk8.md)
- Based on [subsetter](https://talira.ai/catalog/subsetter-5mg54ff0.md)

## Alternatives

- [pdf-writer](https://talira.ai/catalog/pdf-writer-1hvagsht.md): A step-by-step PDF writer.
- [Typst](https://talira.ai/catalog/typst-kghwt0kf.md): The new foundation for documents
- [ironpress](https://talira.ai/catalog/ironpress-g94sb527.md): HTML to PDF. In process. In pure Rust.

## Sources

[^1]: https://github.com/LaurenzV/krilla/blob/main/README.md (checked 20 Nov 2026)
[^2]: https://crates.io/crates/krilla (checked 20 Nov 2026)
