Redactor class
Leave feedback
On this page
Represents the main class that controls the document redaction process, allowing opening, redacting, and saving documents.
Learn more
- More details about applying redactions: https://docs.groupdocs.com/redaction/python-net/redaction-basics/
- More advanced redaction topics: https://docs.groupdocs.com/redaction/python-net/advanced-usage/
The Redactor type exposes the following members:
| Constructor | Description |
|---|---|
| init | Initializes a new Redactor instance using a file path. |
| init | Initializes a new Redactor instance using a document stream. |
| init | Initializes a new Redactor instance for a password-protected document using its path. |
| init | Initializes a new instance of Redactor for a password‑protected document using its path and settings. |
| init | Initializes a new Redactor instance for a password‑protected document using a stream. |
| init | Initializes a new instance of Redactor for a password‑protected document using a stream and optional settings. |
| Method | Description |
|---|---|
| apply | Applies a redaction to the document. |
| apply | Applies a set of redactions to the document. |
| apply | Applies a redaction policy to the document. |
| dispose | Releases resources. |
| generate_preview | Generates preview images of specific pages in a given image format. |
| get_document_info | Retrieves general information about the document, such as size and page count. |
| save | Saves the document to a file using the provided SaveOptions. By default, AddSuffix is set to True and RasterizeToPDF is set to True. |
| save | Saves the document to a file. |
| save | Saves the document to a stream, including custom location. |
| save | Saves the document to the specified stream. |
from groupdocs.redaction import Redactor
from groupdocs.redaction.redactions import RemovePageRedaction, PageSeekOrigin
# Open a PDF document
with Redactor("document.pdf") as redactor:
# Remove the first page
redactor.apply(RemovePageRedaction(PageSeekOrigin.BEGIN, 0, 1))
# Save the redacted document (overwrites the original file)
redactor.save()
Task guides that use Redactor:
- Hello, World!
- Quick Start Guide
- Redaction basics
- Text redaction
- Image redactions
- Metadata redactions
- Annotation redactions
- Spreadsheet redactions
- Remove page redactions
- Get document page preview
- Use redaction policies
- Use redaction callback
- Use PageAreaRedaction
- OCR usage basics
- Use Tesseract OCR
- Load with file type
- Use advanced logging
- Save Word with OOXML compliance
- Get file info
- module
groupdocs.redaction
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.