What GroupDocs.Redaction for Python via .NET Can Do

Delete Metadata in PDF Files with Python

Use Python and GroupDocs.Redaction for Python via .NET to clean sensitive info from your PDF documents. Keep control of your data with easy redaction tools.

Delete Metadata in Pdf Documents

Start protecting your files using GroupDocs.Redaction in Python via .NET apps.

  1. Create a Redactor and load your Pdf file.
  2. Add rules to remove hidden metadata.
  3. Run redaction to delete metadata entries.
  4. Save the file without the hidden data.
import groupdocs.redaction as gr
import groupdocs.redaction.redactions as grr

# Remove metadata from PDF documents

# Choose metadata fields to remove
redaction = grr.EraseMetadataRedaction(grr.MetadataFilters.ALL)

# Open file using Redactor
with gr.Redactor("input.pdf") as redactor:

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

Clean Hidden Content in Documents

With GroupDocs.Redaction for Python via .NET, you can safely remove text, images, and metadata. Keep your files private and secure before sharing.

Redaction Options

Text Removal

Search for and erase sensitive text across documents.

Image Masking

Hide specific parts of images with simple overlays.

Metadata Cleanup

Get rid of unwanted metadata that might expose private data.

Edit and Remove Metadata Fields

This example explains how to clear hidden metadata in a PDF file.

Python

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

# Remove Author metadata
redaction_author = grr.MetadataSearchRedaction("[A-Za-z0-9 ]+", "GroupDocs Company")
redaction_author.filter = grr.MetadataFilters.AUTHOR

# Remove Title metadata
redaction_title = grr.MetadataSearchRedaction(@"[A-Za-z0-9 ]+", "GroupDocs.Redaction Usage")
redaction_title.filter = grr.MetadataFilters.TITLE

# Open the file in Redactor
with gr.Redactor("source.pdf") as redactor:

    # Run redaction process
    redactions = [
      redaction_author,
      redaction_title
    ]
    result = redactor.apply(redactions)

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

About GroupDocs.Redaction for Python via .NET

GroupDocs.Redaction helps Python developers clean up PDF documents by removing text, image content, and 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.

Clean Metadata from PDF with Python

Remove hidden data fields in PDF using Python. A smart way to protect privacy and keep your files clean.

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