A PDF redaction API that deletes the text

Most redaction draws a black box over the words and leaves them in the file. Ours deletes the matching text from the PDF content stream, then re-reads the output with two text engines to prove it is gone.

Open on Apify

Why a black box is not enough

A rectangle drawn over a line of text hides it on screen. The text underneath is still in the file: anyone can select it, copy it or extract it with a script. Search engines and AI tools read it too.

True redaction removes the characters themselves. What is left on the page is a box with nothing behind it.

How it works

  • Matching text is deleted from the page content stream, not drawn over.
  • Scanned pages are read with OCR, then rasterised with the boxes burned into the image.
  • Document metadata (author, title, XMP) and any annotations over redacted text are removed.
  • The output is re-extracted by two independent text engines. verified is true only if nothing matching remains.
  • You get a log CSV with page, type, salted hash, method and box for each redaction. The log never contains the removed text.

Built-in detectors: email addresses, UK and international phone numbers, UK postcodes, National Insurance numbers, IBANs (checksum-validated), sort codes, account numbers and dates of birth. Add your own terms, such as names, addresses or reference numbers; they are matched case-insensitively.

Sample call

Run it as a batch job with the Apify client, in JavaScript:

import { ApifyClient } from 'apify-client';

const run = await new ApifyClient({ token: '<APIFY_TOKEN>' })
  .actor('doubleaigents/pdf-tables-and-true-redaction-mcp')
  .call({
    operation: 'redact_pdf',
    fileUrl: 'https://example.com/letter.pdf',
    terms: ['Jane Smith'],
  });

or Python:

from apify_client import ApifyClient

run = ApifyClient("<APIFY_TOKEN>").actor("doubleaigents/pdf-tables-and-true-redaction-mcp").call(
    run_input={"operation": "redact_pdf", "fileUrl": "https://example.com/letter.pdf",
               "terms": ["Jane Smith"]})
print(run["defaultDatasetId"])

The run writes one dataset item with links to the redacted PDF and the log. AI agents can call the same tool, redact_pdf, over MCP:

https://doubleaigents--pdf-tables-and-true-redaction-mcp.apify.actor/mcp

Authenticate with your Apify API token. PDF, PNG, JPG, TIFF, BMP and WEBP files up to 50 MB and 500 pages are accepted.

Pricing

Each page redacted and verified$0.04
Extra for each scanned or image page (OCR)$0.01

Billed per page through your Apify account, only after a call completes. If your run's maximum charge cannot cover the page count, the call is refused before any work is done.

What it does not do

It is not a named-entity model, so give it the names you need removed. Text inside images on otherwise text-based pages is not read with OCR. Rasterised pages get an OCR text layer, which can contain stray characters near the black boxes.

Need the whole job done rather than an API? We handle subject access request redaction as a service. Our other document tools are on the developers page.

Questions

Is the redacted text really gone?
Yes. Text is removed from the page content, not covered with a box. The output is then re-extracted with two independent engines, and verified is true only if none of the redacted strings can be found.
Does it use an LLM or send my file anywhere else?
No. It runs deterministic code inside the Apify Actor, so the same file gives the same output every time. No third-party API is called.
Will it find names on its own?
No. Detection uses patterns plus your term list; it is not a named-entity model. Pass the names, addresses and references you need removed in terms.
What does a 10-page PDF cost?
$0.40. Add $0.10 if all 10 pages are scans.

Need volume or a private deployment?

The same tools can run on your own hardware, or be built into a pipeline for your documents.

Talk to us