feat(edit-pdf): secure redaction with fail-closed verify - #98
Open
nonamexishere wants to merge 5 commits into
Open
feat(edit-pdf): secure redaction with fail-closed verify#98nonamexishere wants to merge 5 commits into
nonamexishere wants to merge 5 commits into
Conversation
…erify Add a distinct redact object and tool in Edit PDF. Save rasterizes only pages that have regions, burns fill/label into the page image, and fail-closes if source page-content probes remain. Leftover annotations, form values, and attachments are warned, not stripped. Checkpoint before review-bug fixes: rotate fill mapping, missing pdftoppm must not publish, and mixed-job verify probes.
Rasterize a /Rotate-zero sibling so fill lands on the covered words, fail closed when pdftoppm is missing, and probe only the redacted page stream. Preview uses a see-through hatch; the tradeoff banner shows only while the Redact tool is selected.
Address PR McanKul#98 review: scale the raster/fill by /UserUnit, search verify probes only on the redacted page, flatten widgets/annots before the burn, and ignore objectRotate on redact objects.
…cts; warn leftover /V and FileAttachment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a distinct Redact tool in Edit PDF (not a black rectangle stamp). On Save, only pages with a redaction region are rasterized; fill/label are burned into the page image; leftover annotations, form values, and attachments are warned, not stripped. Verification fail-closes if source page-content probes remain. The original file is never overwritten.
Fixes #10.
How it works
kind: "redact"object + canvas tool (separate from Rectangle).pdftoppm→ paint fill/label on the bitmap → replace page contents with one image XObject./Rotatepages rasterize a sibling with rotate forced to 0 so the fill lands on the covered words.pdftoppmfails closed (RENDERER_MISSING); no white-page fallback.#34validate_staged_pdf/qpdf --checkstill gates dest publish. Redacted pages get a rebuilt content digest.Test plan
npm test/npm run typecheck/cargo test --manifest-path src-tauri/Cargo.toml --libqa-rotate90-trim-inside-crop.pdf): black patch sits on the word you covered.