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()