Detect and redact sensitive information in PDF documents while preserving original layout.
Ingest PDF — extract text layer and metadata via pdfplumber/PyMuPDF.
Scan for PII — run regex + AI pattern matching against Chinese and international PII:
Highlight — annotate every match with bounding boxes and category labels.
Confirm — present categories to user for selection. Default: all categories enabled.
Redact — apply chosen mode per category:
blackout — solid black rectangle over sensitive textblur — pixel-level Gaussian blur on image-rendered areaplaceholder — replace with [REDACTED] while keeping surrounding textRebuild PDF — flatten redactions into final output, preserving original fonts, images, and layout.
Report — output redacted PDF + JSON report listing each redaction:
text
pdf-sanitizer redact --input contract.pdf --categories id_card,phone,address --mode blackout
pdf-sanitizer redact --input 社保材料.pdf --output clean.pdf --categories all --mode placeholder
pdf-sanitizer scan --input report.pdf
pdf-sanitizer review --input contract.pdf --page 3-7