Start protecting your files using GroupDocs.Redaction in Python via .NET apps.
- Create a Redactor and load your Pdf file.
- Add rules to remove hidden metadata.
- Run redaction to delete metadata entries.
- Save the file without the hidden data.
Start protecting your files using GroupDocs.Redaction in Python via .NET apps.
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()
With GroupDocs.Redaction for Python via .NET, you can safely remove text, images, and metadata. Keep your files private and secure before sharing.
Search for and erase sensitive text across documents.
Hide specific parts of images with simple overlays.
Get rid of unwanted metadata that might expose private data.
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)
Download GroupDocs.Redaction for free or get a trial license for full access!
Explore documentation, code samples, and community support to enhance your experience.
Remove hidden data fields in PDF using Python. A smart way to protect privacy and keep your files clean.