Key Features of GroupDocs.Redaction for Python via .NET

Hide Content in DOCX Using Python

Use Python to cover private content in DOCX files. Ideal for legal, personal, or business documents.

Keep Private Info Hidden in Docx

With GroupDocs.Redaction for Python via .NET, Python via .NET developers can hide content in just a few lines.

  1. Create a Redactor and open your file.
  2. Choose your redaction settings.
  3. Enter the text to hide and pick a color.
  4. Apply and save the redacted version.
import groupdocs.redaction as gr
import groupdocs.redaction.redactions as grr
import groupdocs.pydrawing as grd

# Hide content in DOCX using overlays

# Configure your redaction options
# Define text and overlay color
color = grd.Color.from_argb(255, 220, 20, 60)
repl_opt = grr.ReplacementOptions(color)
        
redaction = grr.ExactPhraseRedaction("Text to hide", repl_opt)

# Set up the Redactor and load your file
with gr.Redactor("input.docx") as redactor:

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

Extra Redaction Tools

GroupDocs.Redaction for Python via .NET supports different file types so you can protect any content with ease.

Built-in Redaction Features

Find and Edit Text

Search for keywords and hide or replace them quickly.

Cover Image Areas

Block out sensitive areas in scanned pages or photos.

Clean Metadata

Remove hidden info that could expose details.

Find Text with Regex and Redact

Learn how to use regular expressions to find and hide text.

Python

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

# Set pattern and 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 redact
with gr.Redactor("source.docx") as redactor:

    # Run the redaction process
    result = redactor.apply(redaction)

    # Save your clean document
    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

What is GroupDocs.Redaction for Python via .NET?

GroupDocs.Redaction for Python via .NET helps Python developers hide or remove private content in DOCX files. You can block out text, images, and even hidden metadata.
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.

Secure DOCX Files with Python

Cover or delete sensitive content in DOCX documents using simple tools from Python.

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