Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

printwell

Early Development - This project is in active early development. APIs may change, and some features are incomplete. Some commercial features may become free in future releases. Feedback and contributions welcome!

High-performance HTML to PDF conversion powered by Chromium’s rendering engine.

printwell is a library and CLI tool that converts HTML to PDF using Chromium’s Blink rendering engine, compiled as a native library without the browser chrome. This gives you pixel-perfect PDF rendering with full CSS support, web fonts, and modern layout features.

Key Features

  • Pixel-perfect rendering - Uses Chromium’s Blink engine for accurate HTML/CSS rendering
  • No browser required - Compiled as a native library, no Chrome/Chromium installation needed
  • Multiple language bindings - Use from Rust, Node.js, or Python
  • PDF post-processing - Add watermarks, bookmarks, annotations, forms, and more
  • Digital signatures - Sign PDFs with PAdES-compliant signatures
  • Encryption - Password-protect PDFs with AES-256 encryption
  • PDF/A compliance - Generate archival-ready PDFs
  • PDF/UA accessibility - Create accessible PDFs for screen readers
  • Small binary size - ~50MB native library (no V8/JavaScript engine)

Quick Example

CLI

# Convert HTML file to PDF
printwell convert input.html -o output.pdf

# Convert URL to PDF
printwell convert https://example.com -o example.pdf

# Add watermark
printwell watermark input.pdf -o output.pdf --text "CONFIDENTIAL"

# Sign PDF
printwell sign input.pdf -o signed.pdf --cert certificate.p12 --password secret

Rust

use printwell::{Converter, PdfOptions, RenderOptions};

#[tokio::main]
async fn main() -> printwell::Result<()> {
    let converter = Converter::new()?;
    let result = converter.html_to_pdf(
        "<h1>Hello, World!</h1>",
        &RenderOptions::default(),
        &PdfOptions::default(),
    ).await?;
    result.write_to_file("output.pdf")?;
    Ok(())
}

Node.js

import { Converter } from 'printwell';
import { writeFileSync } from 'fs';

const converter = new Converter();
const result = await converter.htmlToPdf('<h1>Hello, World!</h1>');
writeFileSync('output.pdf', result.data);

Python

from printwell import Converter

converter = Converter()
result = converter.html_to_pdf("<h1>Hello, World!</h1>")
result.write_to_file("output.pdf")

Next Steps