Hi, we’re testing PyMuPDF (1.28.0) for a document redaction tool (still evaluating) and found two separate issues in apply_redactions(). Posting a short summary, happy to describe more detail if useful.
- Link annotation /URI values aren’t scrubbed. If a sensitive value appears in page text and in a link’s /URI (common — Word/Acrobat/LaTeX auto-linkify emails and URLs), apply_redactions() removes it from the visible text but leaves the URI intact and recoverable via page.get_links(). Redaction reports success; the value is still in the file. Measured across 39 real documents: 26 leaked this way, 444 recoverable values total, 0 leaks on documents with no links.
- Default image mode inflates output size heavily. apply_redactions() defaults to images=PDF_REDACT_IMAGE_PIXELS, which re-encodes every image on any touched page — roughly +24MB per page touched in our testing, one document going from 24MB to 4.8GB. Switching to images=PDF_REDACT_IMAGE_REMOVE avoids it with no loss of redaction correctness, but it’s a rough default to hit unknowingly.
