What You Can Do with GroupDocs.Redaction for Python via .NET

Use Overlays to Hide Text in WORD with Python

Protect key info in WORD documents by placing overlay blocks using Python and GroupDocs.Redaction for Python via .NET.

Redact Private Content in Word

GroupDocs.Redaction for Python via .NET makes it easy for Python via .NET developers to hide sensitive data fast.

  1. Create a Redactor and load your Word file.
  2. Set up the redaction options.
  3. Pick the text to hide and the overlay color.
  4. Run the redaction and save your file.
import groupdocs.redaction as gr
import groupdocs.redaction.redactions as grr
import groupdocs.pydrawing as grd

# Cover text in WORD using overlays

# Choose what to redact
# Enter the text and set the color
color = grd.Color.from_argb(255, 220, 20, 60)
repl_opt = grr.ReplacementOptions(color)
        
redaction = grr.ExactPhraseRedaction("Text to hide", repl_opt)

# Load the file using Redactor
with gr.Redactor("input.docx") as redactor:

    # Redact and save
    result = redactor.apply(redaction)
    redactor.save()
pip install groupdocs-redaction-net
click to copy
copied
More examples Documentation

More Ways to Hide Info

Use GroupDocs.Redaction for Python via .NET to clean your files by hiding visible and hidden content without changing how they look.

Privacy-focused features

Hide or Replace Text

Protect important info by removing or swapping out words.

Cover Images

Block sensitive images with solid shapes.

Delete Hidden Data

Remove metadata that may reveal system or user info.

Find and Hide Text with Regex

This example shows how to use regular expressions to match and hide content.

Python

import groupdocs.redaction as gr
import groupdocs.redaction.options as gro
import groupdocs.redaction.redactions as grr
import groupdocs.pydrawing as grd

# Set the pattern and overlay color
color = grd.Color.from_argb(255, 220, 20, 60)
repl_opt = grr.ReplacementOptions(color)

redaction = grr.RegexRedaction("\\d{2}\\s*\\d{2}[^\\d]*\\d{6}", repl_opt)

# Open the file to edit
with gr.Redactor("source.docx") as redactor:

    # Apply redaction
    result = redactor.apply(redaction)

    # Save your updated copy
    so = gro.SaveOptions()
    so.add_suffix = True
    so.rasterize_to_pdf = False
    result_path = redactor.save(so)
pip install groupdocs-redaction-net
click to copy
copied
More examples Documentation

Meet GroupDocs.Redaction for Python via .NET

With GroupDocs.Redaction for Python via .NET, Python developers can hide or delete content in WORD documents—like names, numbers, and more.
Learn more
About illustration

Ready to get started?

Download GroupDocs.Redaction for free or get a trial license for full access!

Useful resources

Explore documentation, code samples, and community support to enhance your experience.

Protect WORD Content with Python

Use Python to hide or delete sensitive info in WORD files without affecting the structure or layout.

Temporary license tips

1
Sign up with your work email.
Free mail services are not allowed.
2
Use Get a temporary license button on the second step.
 English