Packages
Pure Elixir utilities for PDF inspection, metadata, tokenizing, merging, page transforms, splitting, stamping, forms, attachments, outlines, text extraction, and native HTML/CSS rendering.
Current section
Files
Jump to
Current section
Files
native_elixir_pdf_utilities
README.md
README.md
<p align="center">
<img src="assets/readme-banner.svg" alt="Native Elixir PDF Utilities" />
</p>
<p align="center">
<a href="https://github.com/Cees-Kettenis/native_elixir_pdf_utilities/blob/main/LICENSE"><img src="https://img.shields.io/hexpm/l/native_elixir_pdf_utilities.svg" alt="License" /></a> <a href="https://hex.pm/packages/native_elixir_pdf_utilities"><img src="https://img.shields.io/hexpm/v/native_elixir_pdf_utilities.svg" alt="Hex.pm" /></a> <a href="https://native-elixir-pdf-utilities.hexdocs.pm/api-reference.html"><img src="https://img.shields.io/badge/hex-docs-blue.svg" alt="HexDocs" /></a> <img src="https://img.shields.io/badge/elixir-~%3E%201.19-4B275F.svg" alt="Elixir ~> 1.19" />
</p>
# Native Elixir PDF Utilities
Native Elixir PDF Utilities renders HTML/CSS to PDF, reads and updates metadata
and bookmarks, extracts embedded text, and merges, transforms, and splits PDFs.
It runs inside Elixir applications without external PDF command-line tools.
## Package and docs
- Package: https://hex.pm/packages/native_elixir_pdf_utilities
- API docs: https://native-elixir-pdf-utilities.hexdocs.pm/api-reference.html
## What it does
1. [Tokenizer](https://github.com/Cees-Kettenis/native_elixir_pdf_utilities/blob/main/docs/pdf-tokenizer.md) - turns PDF byte streams into structured Elixir tokens.
2. [PDF information](https://github.com/Cees-Kettenis/native_elixir_pdf_utilities/blob/main/docs/pdf-information.md) - reads page geometry and document metadata, detects encryption, and updates common metadata fields.
3. [Merger](https://github.com/Cees-Kettenis/native_elixir_pdf_utilities/blob/main/docs/pdf-merging.md) - combines multiple PDF binaries into a fresh PDF with rewritten object references.
4. [Page transforms and splitting](https://github.com/Cees-Kettenis/native_elixir_pdf_utilities/blob/main/docs/pdf-page-transforms.md) - rebuild PDFs after selecting, reordering, deleting, rotating, or splitting pages.
5. [Outlines and bookmarks](https://github.com/Cees-Kettenis/native_elixir_pdf_utilities/blob/main/docs/pdf-outlines.md) - read or replace bookmarks, detect headings in existing PDFs, and generate bookmarks from HTML headings. Merging, transforms, and splitting preserve supported outlines.
6. [Reader](https://github.com/Cees-Kettenis/native_elixir_pdf_utilities/blob/main/docs/pdf-reader.md) and [text extraction](https://github.com/Cees-Kettenis/native_elixir_pdf_utilities/blob/main/docs/text-extraction.md) - strictly resolve embedded Unicode text from classic and modern PDFs.
7. [HTML to PDF](https://github.com/Cees-Kettenis/native_elixir_pdf_utilities/blob/main/docs/html-to-pdf-compatibility.md) - renders a strict, document-oriented HTML/CSS subset to native PDF bytes, with [examples](https://github.com/Cees-Kettenis/native_elixir_pdf_utilities/blob/main/docs/html-to-pdf-examples.md) for common workflows. It supports configured fonts and cross-platform discovery of installed system fonts. Rendering does not require Chromium, wkhtmltopdf, Node, Python, SaaS calls, or a Rust toolchain.
See the [documentation](https://github.com/Cees-Kettenis/native_elixir_pdf_utilities/tree/main/docs) for feature guides, configurable resource limits, and quick reference.
## Installation
```elixir
def deps do
[
{:native_elixir_pdf_utilities, "~> 0.16.0"}
]
end
```
## Development
Run the complete supported-version quality matrix before contributing:
```bash
./scripts/quality-matrix
```
The matrix compiles and tests the supported Elixir versions, enforces formatting
and 100% coverage, runs Dialyzer, and compares HTML-to-PDF fixtures with
Chromium. See the
[contribution guide](https://github.com/Cees-Kettenis/native_elixir_pdf_utilities/blob/main/CONTRIBUTING.md)
for prerequisites, quicker installed-version checks, and result interpretation.
## License
The library source is MIT licensed. Bundled DejaVu font files use the Bitstream
Vera license; WHATWG character-reference data and Adobe glyph-name data retain
their respective BSD 3-Clause notices. See the complete
[license texts](docs/licenses.md).