Open-source PDF library

PDFs, meet code.

Read, annotate and transform PDFs in Rust, Python or JavaScript. Sealwax processes files wherever your code runs, from the server to the browser.

Atlas boréal cover with an illustration of forested ridges, rendered by Sealwax.
atlas.pdfSample PDF · 1 page

From PDF to PNG.

Download the atlas and install Sealwax. In a few lines, render the first page as an image at 2× scale.

Download atlas.pdf

Python

pip install sealwax
from pathlib import Path
import sealwax

pdf = Path("atlas.pdf").read_bytes()
doc = sealwax.Document.from_bytes(pdf)
png = doc.render_png(0, scale=2)
Path("atlas.png").write_bytes(png)

Rust

cargo add sealwax
use sealwax::{raster, Document, OpenOptions};
use std::{error::Error, fs};

fn main() -> Result<(), Box<dyn Error>> {
    let pdf = fs::read("atlas.pdf")?;
    let doc = Document::open(pdf, &OpenOptions::default())?;
    let png = raster::render_png(&doc, 0, 2.0)?;
    fs::write("atlas.png", png)?;
    Ok(())
}

Node.js

npm install sealwax
import { readFile, writeFile } from "node:fs/promises";
import { Document } from "sealwax";

const pdf = await readFile("atlas.pdf");
const doc = Document.fromBytes(pdf);
const png = doc.renderPng(0, 2);
await writeFile("atlas.png", png);
doc.free();

CLI

cargo install sealwax-cli
sealwax render atlas.pdf \
  --page 1 \
  --scale 2 \
  --out atlas.png

From parsing to signing.

Read and transform

Extract text with its coordinates, render a page as a PNG, or fill form fields and flatten them into the page.

Set resource limits

Set a deadline and cap pixels and decoded bytes. In Python, sealwax.isolated can also process incoming PDFs in a separate process.

Archive and sign

In Rust or Python, convert to PDF/A-3 and apply PAdES signatures up to B-LTA. Your private key stays in your signing service.

Free, even in production.

Use, modify and redistribute Sealwax, including in a commercial product. The library is free under your choice of the MIT or Apache-2.0 license.