English
Redact a PDF
Permanently removes data from a PDF, text or scanned: detected identifiers (NIR, IBAN, card, email, phone) and given terms (names, addresses). The masked text no longer exists in the produced file — it is not a box drawn on top.
Redact a PDF permanently removes data from a PDF, text or scanned: detected identifiers (French social security number, IBAN, card number, email, phone) and given terms (names, addresses, references). The redacted PDF is added to the run attachments, next to the original.
It is not a black box drawn over the text: the pages concerned are rebuilt from a redacted image, and the masked text no longer exists in the file — it cannot be selected, copied or extracted. See Documents › Redacting for good.
The node is only offered when the instance has a documents service.
At a glance
- Type:
pdf.redact· version 1 - Category: Data
- Kind: Step — one stage of a run
- Effect: No external effect (
none) — nothing is written outside Loop & Roll; safe to replay - Needs a carrier email: No
- Connection: None
- Inputs:
main - Outputs:
main
Parameters
selection
Attachments to use
- Type: One choice (
options) - Required: Yes
- Default:
all - Options:
all— All attachments: Those of the triggering email, then the files added by earlier steps (a fetched deed, a signed PDF), in that order.first— The first one only: The first attachment, when only one matters.byMime— By file type: By MIME type:application/pdf, or a whole family withimage/*.byName— By file name: By name pattern:*.pdf,invoice-*.
mime
File type — Exact MIME type (application/pdf) or a whole family (image/*). Left empty, no attachment is kept.
- Type: Text (
string) - Required: No
- Default:
""(empty) - 200 characters at most
- Example:
application/pdf - Shown when:
selectionisbyMime - Expressions:
{{ }}accepted
namePattern
File name — Simple pattern: * matches anything, ? one character (*.pdf, invoice-*). Case is ignored.
- Type: Text (
string) - Required: No
- Default:
""(empty) - 200 characters at most
- Example:
*.pdf - Shown when:
selectionisbyName - Expressions:
{{ }}accepted
detectors
Detect and mask — Identifiers are validated (NIR key, IBAN checksum, card Luhn): a 16-digit order reference is not masked by mistake.
- Type: Several choices (
multiOptions) - Required: No
- Default:
["nir","iban","payment_card","email","phone"] - Options:
nir— French social security number (NIR)iban— IBANpayment_card— Payment card numberemail— Email addressphone— Phone number
terms
Terms to mask — One term per line: names, addresses, references. Often the output of an upstream AI node: {{ data.extract.parties }} (a list is accepted). Case, accents and spacing are ignored.
- Type: Long text (
text) - Required: No
- Default:
""(empty) - 20000 characters at most
- Example:
John Smith 12 Lilac Street - Expressions:
{{ }}accepted
ocr
Text recognition (OCR)
- Type: One choice (
options) - Required: Yes
- Default:
auto - Options:
auto— For scanned pages: A page with no selectable text is read by OCR.always— For every page: For a scan that already carries a poor text layer. Slower.never— Never: Scanned pages are not examined: the report flags them.
- Shown under “Advanced” in the editor
suffix
Produced file suffix — Appended to the original name: contract.pdf becomes contract-redacted.pdf.
- Type: Text (
string) - Required: No
- Default:
-anonymise - 60 characters at most
- Example:
-redacted - Shown under “Advanced” in the editor
- Expressions:
{{ }}accepted
Outputs
main
Data produced
What this node adds to the run data, and how to read it in an expression. <step> stands for the step key: the node name turned into an identifier (see Data and expressions).
{{ data.<step>.position }}—number. The position of the first redacted PDF in the run attachments.{{ data.<step>.files }}—array of { position, filename, mime, size, origin }. The redacted PDFs, added to the run attachments (one per PDF processed).{{ data.<step>.documents }}—array of { source, file, report }. For each PDF: the original attachment, the produced PDF and the report.{{ data.<step>.documents.0.report }}—{ pages, redactedPages, ocrPages, unscannedPages, detected, terms, total }. What was masked, COUNTED and never quoted: redacted pages, pages read by OCR, scanned pages not examined (OCR Never), occurrences per detector (detected.iban…), occurrences per given term with a masked preview (J*** D*****), total.{{ data.<step>.total }}—number. The total number of masked areas, all PDFs together.{{ data.<step>.summary }}—string. A one-line description for the run detail, in the member's language.
Example
A rental file arrives with documents as PDFs. An Extract node named extract takes out the list of people named (parties) and their addresses (addresses). The node:
selection: byMime
mime: "application/pdf"
detectors: [nir, iban, payment_card, email, phone]
terms: |
{{ data.extract.parties }}
{{ data.extract.addresses }}A list (["John Smith", "Marie Curie"]) is accepted like a series of lines. Then an upload to SharePoint that only takes the files added by this step.
What is detected
The NIR, the IBAN and the card are recognised and validated by the rules of the sensitive data filter (key, modulo 97, Luhn). Email and phone (French formats and prefixed international numbers) are added. Given terms are searched regardless of case, accents and spacing, including inside a word.
Pages without selectable text (scans) are read by OCR, in French and English (Text recognition set to For scanned pages). For every page forces OCR, for a scan whose text layer is poor.
Tips
- Nothing to mask. Without a detector or a term, the step is refused (
node_invalid_param). A PDF where nothing is found is still returned, cleaned of its annotations and metadata, with a zero report. - At most 5 PDFs per step and 100 pages per PDF. Redacted pages become images (200 dpi) with an OCR text layer; the other pages are untouched.
- Test runs. In a test run the PDF is really redacted: check the result before publishing.
- Errors. Password-protected, damaged or too long PDF:
document.invalid_document. Service unavailable:document.service_unavailable, retried.