PDF Privacy Masker

What PDF redaction detects — and when it misses

This page explains why certain data is redacted and why some is left alone. If a result looks wrong or something was missed, start here.

Nine categories it detects

TypeFormats coveredAfter redaction
Mobile numbers13800138000, 138****, +86 138…, and separator variantsFully covered
ID numbers18- and 15-digit, with check digit and region-code validationFully covered
Bank cards16–19 digits, Luhn-checked to avoid false positivesFully covered
EmailCommon email formatsFully covered
LandlinesArea code-number, Area code + space + numberFully covered
AddressesProvince/city/district + street and house number, e.g. "XX Road XX No. XX Room"Fully covered
Dates of birthOnly dates with "born / birthday / date of birth" contextFully covered
Gender / age"Gender: female", "Li Si, male, born 1990…"Covered
NamesRecognised in ordinary sentences, without a "Name:" labelGiven name masked, surname kept

Number-like fields are checked first: ID check digits, bank card Luhn checks, so stray numbers are not mistaken for private data.

What is never redacted

Ordinary dates (meetings, contracts, signing, travel), amounts, licence plates, tracking numbers, employee IDs, model numbers and house numbers are left untouched. Redaction targets personal privacy, not business information — the other half of "accuracy" is not blacking out whole pages. Zero leakage alone is not a passing result here.

How names are judged

RuleExplanation
No label neededNames in ordinary prose are recognised without a "Name:" prefix
Mask given name, keep surname陈嘉豪 → 陈██; compound surnames kept: 欧阳志强 → 欧阳██. Lists and contact books need to tell people apart; masking everything makes checking impossible
Uncertain names are listed as "possible"Not ticked by default; you tick them to redact. E.g. "Li Minghui Team" or "Xie Tiancheng Studio" — impossible to tell whether it is a person or an organisation
Certain endings are skippedNames ending in "town / garden / road / street / village / manor" are skipped; those characters cannot be told apart from place names, so better to miss than to redact body text by mistake
Names split across lines are missedWhen the surname ends one line and the given name starts the next, line-by-line processing cannot recognise them — select manually

Special layouts

ScenarioHandling
Multi-page PDFsPage by page; the header shows "X/Y pages with content" and the page break shows "N items on this page"
Several people on one page, multiple table rowsRecognised separately, never merged; several people in one paragraph are judged individually
Adjacent table cellsWhen cells have no dividing lines and numbers run together, they are split into segments within the string
Fillable form PDFsFields you can click and type into are recognised too; their values are removed from the file as well
Scans / photographed pagesPages without a text layer are first processed with local OCR (PP-OCRv4, fully offline) to recover text and per-character coordinates, then the same rules apply; the UI marks which pages used OCR

Why the mosaic cannot be reversed

It is not a black box drawn over text. Four steps: the source region is resampled into small pixel blocks, discarding glyph detail; the region is flattened to an average colour with random noise, so pixels no longer correspond to the original; the text layer is deleted as well, so copying, searching and extracting return nothing; the result is saved as a new PDF with document properties cleared.

Redacted content cannot be restored, and no "de-mosaic" tool can bring it back.

Eight known limits

#LimitEffectWhat to do
1Blurry scans or tiny text (below 200 dpi)OCR misreads or misses textReview the results and select missed items manually; an empty automatic result does not mean there is no private data
2Long runs of identical digits (e.g. 13655556666)At low resolution they may be merged into fewer digitsScan at 300 dpi where possible and check each recognised result
3Encrypted PDFsCannot be openedRemove the password before importing
4Numbers written with Chinese digitsNot recognisedSelect manually
5Names ending in "town / garden / road / street / village / manor"Missed on purposeSelect manually
6Names or numbers split across linesMay be missedSelect manually
7Uncertain names appear only as "possible"Not redacted by defaultTick them manually in the list
8Handwriting, decorative fonts, stampsNot recognisedSelect manually
Every automatic detector misses things. Page through the results when you finish; scans have a higher miss rate because of OCR. Select missed regions manually — manual redaction is just as irreversible.

Where these numbers come from

Six test documents with 452 private items produced identical results on Windows and Android, with a maximum coordinate difference of 0.55pt; official documents with no private data produced zero false positives. For scans, eight pages of real paperwork (CV, rental contract, outpatient record, bank statement, shipping label, etc.) were rendered as full-page images with 0.3–1.2 degree skew and noise added. The finished PDF has no text layer at all, so OCR is the only route: all 86 ground-truth items passed (0 missed / 0 leaked / 0 wrongly redacted). All names, numbers and addresses in the test documents were randomly generated fiction.

Original notes and test scripts are in the repository: Detection rules and known limits (repo version), Test scripts and samples。

Download (Gitee — faster in China) FAQ Back to home