Skip to content
dialegein

pdf-redactor

Python library that redacts a PDF's text layer, links and metadata by regex.

Jobs Protect

Since 2016

Operated by Joshua Tauberer

Visit pdf-redactor

Opens the vendor's own site.

Jobs covered

Open a task to see exactly what the vendor documentation supports.

Protect Browse all protect tools

redacting selected content from an existing PDF with pdf-redactor: regex/filter-function substitution in the page text layer, plain-text annotations, link target URLs, the Document Information Dictionary and embedded XMP metadata, with metadata fields rewritten, removed or added and a new PDF written. The scope records pattern-based text/annotation/link/metadata redaction only; it does not claim password encryption, permissions, irreversible removal of all sensitive content, image/graphic sanitisation, embedded-file/script/form/signature coverage or complete PDF sanitisation, and it preserves the project's explicit exclusions and font/compression caveats

Where your files are processed

No server involved

Python module and script that must be installed and run on your own machine. The project publishes no hosted service, so there is no server in the path. That is a property of the library itself: what an application built with it does with your file depends on that application, not on this.

Architectural: a Python module and script installed and run on the caller's own machine. The PDF is parsed and rewritten locally, and the project publishes no hosted service or account.

This describes the package's processing path, not an audit of every application that embeds it or an absolute no-network guarantee for a caller that fetches/sends files.

What it does

pdf-redactor is a small pure-Python module (version 0.0.1, released 19 April 2021) built on pdfrw that redacts selected content from an existing PDF: content-stream text via regular expressions or filter functions, plain-text annotations, link target URLs, the Document Information Dictionary and embedded XMP metadata. It rewrites the underlying text in the content stream rather than drawing boxes over it, so matched characters leave the text layer; metadata fields can be rewritten, removed or added.

It is not a complete PDF sanitiser or encryption tool: images, graphics and other embedded resources are explicitly untouched, and embedded files, multimedia, scripts, rich-text annotations, forms, internal object names and digital signatures are not examined. The command-line wrapper does nothing useful without custom filter functions, so the documented use is as a library (or with the example script); qpdf may be needed to uncompress/recompress streams, and replacement glyphs can be missing from fonts.

The package is CC0-1.0 and runs locally in Python >=3.7.

Best for

Developers who need scripted, repeatable text-layer and metadata redaction as one step in a pipeline, and who will review exactly what the tool does and does not touch before trusting it with sensitive material.

Worth knowing

Protect here means pattern-based text-layer/annotation/link/metadata redaction, not password encryption, permissions, complete sanitisation or a guarantee that no sensitive content remains. The project is explicitly incomplete: images, graphics, embedded files, multimedia, scripts, rich-text annotations, forms, internal object names and digital signatures are not examined; sensitive content inside an image survives.

The bare command-line entry point performs no filtering without custom filter functions, so use it as a library or adapt the example. Replacement characters can be missing from embedded fonts, and pdfrw does not support every compression method, so qpdf may be needed before/after.

CC0-1.0, no hosted service and no account; local processing is architectural rather than an upload test. The project is still versioned 0.0.1 (PyPI 19 April 2021); its repository was last pushed in June 2024 and it has 22 open issues, so maintenance should be checked.

Redaction is not a legal-compliance or security guarantee; review the output and the document's other content.

Details, and where each comes from

Vendor statements, our own reading of their pages, and the things nobody has established yet, each answered separately. Where we have not confirmed something it says so rather than guessing, and a row nobody has established is greyed out.

Versions covered
Windows · macOS · Linux
Website
github.com
Requires an account
Not applicable
Watermark on the free tier
No
Maximum file size
Not verified
Batch processing
No
Data residency
Self-hosted
Open source
Yes
Self-hostable
Yes
Licence
CC0-1.0 public-domain dedication (not MIT).

CC0-1.0 public-domain dedication (not MIT). The package metadata declares CC0-1.0; the README credits Joshua Tauberer and Antoine McGrath.

The current PyPI release is 0.0.1, uploaded 19 April 2021, requires Python >=3.7 and <4, and depends on pdfrw and defusedxml. There is no paid edition, hosted service or account.

Redaction
Removes the content
Programmatic access
Embeddable library
Last availability check
Responded in 460 ms 21 October 2026

Checked automatically by our own runner, not reported by the vendor. 96.7% of our last 30 checks got a response.

What the redaction verdict rests on

Tested by us on 17 September 2026, on our own canary document rather than read off a product page.

What that does not establish

Tested on our own canary document: it matches the text layer by pattern and rewrites the characters out. Its own documentation says images, embedded files, forms and signatures are not examined, so a redacted scan may still show everything.

What the vendor says

Claims are labelled rather than repeated as fact. Where we have checked something ourselves, it says so and shows when. Checked means we read the vendor's own page and it says what we recorded - not that we tested the behaviour, unless the note says we did.

  • “A general-purpose PDF text-layer redaction tool, in pure Python, by Joshua Tauberer and Antoine McGrath.”

    Checked by us - the source says this Read 22 September 2026

    Confirmed verbatim - the claim is the first line of the README, unaltered - and unlike the other two in this batch, the wording is a description of what the tool is rather than a promise about what it does, so the test is what settles the useful part. That test found it removes content: it matches the text layer by pattern and rewrites the characters out.

    The README's own Limitations section is the thing a reader most needs and the claim does not carry, and it is unusually candid: the tool does not look at embedded files, multimedia, scripts, rich text annotations, forms, internal object names or digital signatures, and it says plainly that ensuring the input only uses capabilities the tool understands is 'your responsibility'. It also warns that some PDFs need qpdf to uncompress the streams first, and that fonts without full glyph coverage can mean replacement text does not render.

    So: confirmed for what it is and for what we observed, with the caveat that its coverage is narrower than the word 'redaction' suggests.

    Standing: Re-read and matched byte for byte

    Check it yourself: the source, the SHA-256, and how we checked
    From
    the text a browser renders
    SHA-256
    7da3483925d84d84713a18797e709df7905400443f4350d2b181fa62206a2f70
    Note
    no saved artifact matches this hash, so the normalised comparison has nothing to normalise towards. The raw response and a render both fail to reproduce it; the GitHub page embeds fingerprinted asset names that change.

    How we checked

    Re-verified verbatim on 2026-09-22: https://github.com/JoshData/pdf-redactor re-rendered in headless Chrome with scripts/render-page.mjs and the claim's wording found in the rendered text. Originally verified on 2026-09-21. sourceHash is the SHA-256 of the re-rendered text, held as rv-github-com-JoshData-pdf-redactor-30a22d1d.txt.

    What this hash proves, and what it does not

  • “Graphical elements, images, and other embedded resources are not touched.”

    Checked by us - the source says this Read 22 September 2026

    Confirmed verbatim: the sentence appears unaltered in the README's list of limitations. It is the most consequential sentence in this entry and one of the most consequential in the index, because it bounds the same tool's redaction claim: a redaction performed with pdf-redactor leaves every image, embedded file and graphic untouched, so a scan of a redacted page still shows what was removed.

    The claim is recorded in the capability tier rather than the redaction tier because of how the ranking matched it, and this finding says plainly that it belongs in a reader's mind next to pdf-redactor's redaction entry, which the index already carries.

    Standing: Re-read and matched byte for byte

    Check it yourself: the source, the SHA-256, and how we checked
    From
    the text a browser renders
    SHA-256
    7da3483925d84d84713a18797e709df7905400443f4350d2b181fa62206a2f70

    How we checked

    Re-verified verbatim on 2026-09-22: https://github.com/JoshData/pdf-redactor re-rendered in headless Chrome with scripts/render-page.mjs and the claim's wording found in the rendered text. Originally verified on 2026-09-21. sourceHash is the SHA-256 of the re-rendered text, held as rv-github-com-JoshData-pdf-redactor-30a22d1d.txt.

    What this hash proves, and what it does not

  • “This Python module is a general tool to help you automatically redact text from PDFs.”

    Checked by us - the source says this Read 22 September 2026

    RE-QUOTED 2026-09-22: this claim previously read "A general purpose PDF text-layer redaction tool: patterns are matched against the text layer and the matched characters are rewritten out of it." - our characterisation rather than the vendor's wording, so a reader could not tell a quotation from a summary. The vendor's own sentence is now in the claim field and what we read from it follows here.

    The boxed string is gone from the saved file; the lines 40pt above and below it survived, as did the untouched second page, so the removal is localised. The output contains zero image XObjects, so nothing was rasterised: the marked text is deleted from the page structure and a solid fill is drawn in its place. qpdf reports no errors and agrees on every marker.

    One observation that surprised me and is recorded rather than explained away: the replacement text supplied to its filter did not appear in the output either, so it appears to remove matched characters rather than substitute them. That is consistent with what the tool is for.

    Its documented limits are unchanged and untested here - images, embedded files, forms and signatures are not examined, so a redacted scan may still show everything.

    Standing: Re-read and matched byte for byte

    Check it yourself: the source, the SHA-256, and how we checked
    From
    the text a browser renders
    SHA-256
    7da3483925d84d84713a18797e709df7905400443f4350d2b181fa62206a2f70

    How we checked

    Re-verified verbatim on 2026-09-22: https://github.com/JoshData/pdf-redactor rendered in headless Chrome with scripts/render-page.mjs, and this sentence found in the rendered text. ALSO RE-QUOTED on the same date: the claim field previously held our own summary of this page rather than the vendor's sentence, which made it impossible to verify by quotation - the schema's own words are "we do not repeat a vendor's claim as though it were our own finding", and the reverse holds too. sourceHash is the SHA-256 of the rendered text, held as rv-github-com-JoshData-pdf-redactor-30a22d1d.txt.

    What this hash proves, and what it does not

Each claim is quoted from the vendor's own pages. This section describes what we have and have not checked - it is not a judgement about anyone.

Sponsorship is distribution, not an endorsement or a promise of search rankings, AI citations, traffic, or sales. This listing is a free entry, compiled from published sources.

Visit pdf-redactor Report a problem

Related reading

How this record was put together

Editorial review.
No editor has signed this record off. That is not the same as nothing having been checked, and the lines below say what has.
Source reading.
3 claims taken from the vendor's own pages, read between 22 September 2026 and 22 September 2026.
Website availability.
The vendor's site was last checked on 21 October 2026.
Behaviour testing.
We ran this ourselves. The file handling was watched directly.

Sources: https://pypi.org/project/pdf-redactor/ (0.0.1, 19 April 2021, Python >=3.7,<4, CC0-1.0, pdfrw/defusedxml; read 2026-10-16); https://github.com/JoshData/pdf-redactor (CC0-1.0, created 2016-10-14, last push 2024-06-13, 22 open issues; read 2026-10-16); README (text layer, annotations, links, Info/XMP metadata, exclusions, CLI/filter, qpdf/font caveats; read 2026-10-16).