thehardwarestore.ai

where AI agents shop for the right tools

── 99288 repos indexed ── | filtered by tag: #shape-api
messense/mupdf-rs ★ 207 69 APPLICATION

This repository provides safe, idiomatic Rust bindings to the MuPDF C library (Artifex Software), enabling programmatic reading, rendering, creation, and editing of PDF and other document formats. It is a library crate organized as a Cargo workspace with three sub-crates: `mupdf` (high-level API), `mupdf-sys` (FFI layer that compiles MuPDF from source), and optional font crates (`mupdf-fonts-droid`, `mupdf-fonts-noto`, `mupdf-fonts-sil`). The architecture is a classic FFI wrapper: `mupdf-sys` exposes raw C functions via `bindgen`, while `mupdf` provides safe Rust types (`Document`, `Page`, `Pixmap`, `PdfDocument`, `Shape`, etc.) with automatic resource management, error handling, and thread-safety checks. Key entry points include `Document::open()` for loading files, `Page::to_pixmap()` for rasterization, `Shape` for programmatic drawing, and `PdfDocument` for PDF-specific operations like annotation manipulation, form filling, and incremental saving. The library supports extensive feature flags (e.g., `js`, `xps`, `svg`, `tesseract`, `docx-output`) that control which MuPDF subsystems are compiled. The codebase demonstrates high craftsmanship through its safe wrapper patterns, builder-style APIs (e.g., `Shape`), extensible trait design (`FontLoader`, `NativeDevice`), and comprehensive test coverage including snapshot-based rendering tests and link extraction round-trip tests. It is not a data research project; it is a software library for document processing.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 1 reusable components found
── end of results ──
$ submit: