Redactor class

Redactor class

Represents a main class that controls document redaction process, allowing to open, redact and save documents.

Learn more

The Redactor type exposes the following members:

Constructors

Constructor Description
init Initializes a new Redactor instance using a file path.
init Initializes a new instance of Redactor using a stream.
init Initializes a new instance of Redactor for a password‑protected document using its path.
init Initializes a new Redactor instance 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 settings.

Methods

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.
apply_redaction
apply_redaction_policy
dispose Releases resources.
generate_preview Generates preview images of specific pages in a given image format.
generate_preview_preview_options
get_document_info Retrieves the general information about the document, such as size and page count.
save Saves the document to a file with the following options: AddSuffix = True, RasterizeToPDF = True.
save Saves the document to a file.
save Saves the document to a stream, including custom location.
save_save_options
save_stream
save_streams

Example

from groupdocs.redaction import Redactor
from groupdocs.redaction.redactions import RemovePageRedaction, PageSeekOrigin

# Open a document and remove the first page
with Redactor("document.pdf") as redactor:
    redactor.apply(RemovePageRedaction(PageSeekOrigin.BEGIN, 0, 1))
    redactor.save()

Guides

Task guides that use Redactor:

See Also