Skip to main content

rightkit_pdf/
lib.rs

1//! RightKit PDF engine: the pure, Tauri-free half of the PDF edit pipeline, extracted from
2//! ViewRight's `crates/pdf` (the most mature donor), plus ScrapeRight text extraction and Legion
3//! page merge as opt-in features.
4//!
5//! Every function takes bytes, paths, or in-memory `lopdf::Document`s and returns typed values.
6//! Path authorization (the host's file broker) stays in the app; [`commit`] provides the atomic
7//! disk write once the host has authorized a target.
8//!
9//! | module    | responsibility                                                    |
10//! |-----------|-------------------------------------------------------------------|
11//! | `model`   | wire types: commands, islands, locators, typed `PdfEditError`     |
12//! | `inspect` | page graph walk: text islands with quads, fonts, source locators  |
13//! | `font`    | bundled + system font catalog, subsetting, ToUnicode              |
14//! | `compose` | sparse-write composition of edit commands onto fresh bytes        |
15//! | `save`    | candidate verification, single-use save tokens, commit resolution |
16//! | `commit`  | atomic on-disk write for a resolved save token                    |
17//! | `merge`   | (feature `merge`) merge PDFs, select/reorder pages                |
18//! | `extract` | (feature `extract`) text extraction, whole-document and per page  |
19
20pub mod commit;
21pub mod compose;
22#[cfg(feature = "extract")]
23pub mod extract;
24pub mod font;
25pub mod inspect;
26#[cfg(feature = "merge")]
27pub mod merge;
28pub mod model;
29pub mod save;
30#[cfg(test)]
31mod test_fixtures;