tpt-pdf

Rust

Pure-Rust PDF processing library — layout-aware extraction, pixel-perfect rendering, and PDF generation with zero-copyleft dependencies. Dual-licensed MIT/Apache-2.0.

0 stars0 forks0 watchersApache License 2.0

Languages

Rust91.8%Go1.8%Java1.5%Python1.5%C1.2%C++1.1%JavaScript1.1%
README

tpt-pdf

Dual-licensed MIT OR Apache-2.0 | Pure-Rust PDF processing stack

Build a complete, production-ready PDF processing library in pure Rust that provides content intelligence, pixel-perfect rendering, and PDF generation with zero GPL dependencies.

Mission

This project delivers a comprehensive PDF processing stack for Rust applications. Every component is MIT or 0BSD licensed, making it safe for commercial and open-source use.

Architecture

tpt-pdf-viewer      (Optional GUI Layer)
    - Window management (winit)
    - GPU-accelerated rendering (wgpu)
    - Interactive features (zoom, pan, search, annotations)

tpt-pdf-render      (Pixel-Perfect Rendering Engine)
    - PDF operator execution engine (bytecode interpreter)
    - Font rendering pipeline (TrueType hinting, subpixel)
    - Color management (ICC profiles, CMYK, spot colors)
    - Image decoding (JPEG, JPEG2000, JBIG2, CCITT)
    - Graphics pipeline (paths, transparency, patterns, clipping)
    - Output targets (screen bitmap, PostScript, high-DPI print)

tpt-pdf-intelligence (Content Analysis)
    - Content stream parser (PDF operator AST)
    - Layout-aware text extraction (columns, reading order)
    - Algorithmic table detection (grid analysis)
    - Font subsetting (TrueType/OpenType reduction)
    - Format conversion (PDF ↔ Markdown/HTML/JSON)

tpt-pdf-generation   (PDF Creation)
    - Document builder API
    - Font embedding and subsetting
    - Digital signatures (PKCS#7)
    - PDF/A and PDF/UA compliance

tpt-pdf-core         (Foundation)
    - PDF object model (dictionaries, arrays, streams)
    - Cross-reference table parsing
    - Compression (FlateDecode, LZW, ASCII85)
    - Encryption/decryption (RC4, AES)
    - Incremental updates

Crates

CratePurpose
tpt-pdf-coreLow-level PDF object model and file format handling
tpt-pdf-intelligenceLayout-aware text extraction, table detection, format conversion
tpt-pdf-renderPixel-perfect PDF rendering to bitmap images
tpt-pdf-generationCreate new PDF documents with signing and compliance
tpt-pdf-viewerGPU-accelerated PDF viewer application (optional GUI layer)

Getting Started

# Build all crates
cargo build --all-targets --all-features

# Run tests
cargo test --all-targets --all-features

# Check formatting
cargo fmt --all -- --check

# Lint
cargo clippy --all-targets --all-features -- -D warnings

# License compliance
cargo deny check licenses

License

This project is dual-licensed under MIT or Apache-2.0. You may choose either license at your option.

See LICENSE-MIT and LICENSE-APACHE for full text.