Perform redactions on your documents with just a few lines of code. The topics below cover the core redaction operations using a local sample.docx (the same patterns apply to PDF, Excel, PowerPoint, and image files). Every example is runnable — copy the script, download the linked sample file, and run it.
In this section
Redaction Basics — apply a single redaction or several at once, and check the redaction result.
Text Redactions — replace or black out text by exact phrase (case-sensitive or RTL) or regular expression.
Metadata Redactions — erase metadata wholesale or by filter, or rewrite values that match a pattern.
Image Redactions — black out an image area, clean embedded image metadata, and redact embedded images.