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 (through `rightkit-fs`) 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` | (feature `edit`) lock, recheck and rightkit-fs replace of a token |
17//! | `merge` | (feature `merge`) merge PDFs, select/reorder pages |
18//! | `extract` | (feature `extract`) text extraction, whole-document and per page |
19
20#[cfg(feature = "edit")]
21pub mod commit;
22#[cfg(feature = "edit")]
23pub mod compose;
24#[cfg(feature = "extract")]
25pub mod extract;
26#[cfg(feature = "fonts")]
27pub mod font;
28pub mod inspect;
29#[cfg(feature = "merge")]
30pub mod merge;
31pub mod model;
32#[cfg(feature = "edit")]
33pub mod save;
34#[cfg(test)]
35mod test_fixtures;