Files
pdfcraft/crates/ui-egui/src/workflows.rs
T
bmh129 a10906e991 M10: Recognize Text in the browser, read in Web Workers (ocr.ocr-web)
The web build downloads the OCR models the first time Recognize Text (or
Edit on a scanned page) needs them, installs the engine, and reads pages
in up to two Web Workers (apps/pdfcraft-ocr-worker) built with WebAssembly
SIMD, so the page keeps responding. The page prepares each page and sends
its image to an idle worker, which runs ocrs and sends the lines back.
Where no worker can start, the page reads with the installed engine.
Answers go back to the run that sent the page (ocr_route), so a single
run and a batch can overlap.

Recognize Text in Multiple Files on the web keeps main's skipped-files
bucket, low-confidence notes and cancel between files. Files chosen
before the models are in wait for them. A scan Edit finds while no engine
can read it waits for the models instead of counting as no scan.

Trunk builds the worker beside the app; `cargo xtask web-worker-link`
hashes its files and names it in index.html. The web zip ships the
models in models/.
2026-11-07 21:35:50 -06:00

21 lines
547 B
Rust

pub(super) mod a11y_ui;
pub(super) mod actions_ui;
pub(super) mod combine_grid;
pub(super) mod combine_ui;
pub(super) mod compare_ui;
pub(super) mod create_multiple_ui;
pub(super) mod create_ui;
pub(super) mod export_ui;
pub(super) mod files;
pub(super) mod js_ui;
#[cfg(any(target_arch = "wasm32", test))]
pub(super) mod ocr_route;
pub(super) mod ocr_ui;
pub(super) mod ocr_verify;
#[cfg(target_arch = "wasm32")]
pub(super) mod ocr_web;
pub(super) mod optimize_ui;
pub(super) mod print_ui;
pub(super) mod scan_clean_ui;
pub(super) mod web_print;