kuroi.core.redaction¶
redaction ¶
Apply Findings to a PDF using PyMuPDF's true-redaction operation.
True redaction (page.apply_redactions) rewrites the content stream so the removed text is no longer recoverable, unlike a black box drawn over the page.
apply_redactions ¶
apply_redactions(pdf_path: Path, findings: list[Finding], pages: tuple[Page, ...], output_path: Path) -> None
Write a redacted copy of pdf_path to output_path.
Findings are translated into bbox unions over their word ranges, registered as redact annotations, and then applied page-by-page.