Redactor class
Redactor class
Represents a main class that controls document redaction process, allowing to open, redact and save documents.
The Redactor type exposes the following members:
Constructors
| Constructor | Description |
|---|---|
__init__(self, file_path) |
Initializes a new instance of Redactor class using file path. |
__init__(self, document) |
Initializes a new instance of Redactor class using stream. |
__init__(self, file_path, load_options) |
Initializes a new instance of Redactor class for a password-protected document using its path. |
__init__(self, file_path, load_options, settings) |
Initializes a new instance of Redactor class for a password-protected document using its path and settings. |
__init__(self, document, load_options) |
Initializes a new instance of Redactor class for a password-protected document using stream. |
__init__(self, document, load_options, settings) |
Initializes a new instance of Redactor class for a password-protected document using stream and settings. |
Methods
| Method | Description |
|---|---|
apply(self, redaction) |
Applies a redaction to the document. |
apply(self, redactions) |
Applies a set of redactions to the document. |
apply(self, policy) |
Applies a redaction policy to the document. |
save(self) |
Saves the document to a file with the following options: AddSuffix = true, RasterizeToPDF = true. |
save(self, save_options) |
Saves the document to a file. |
save(self, document, rasterization_options) |
Saves the document to a stream, including custom location. |
generate_preview(self, preview_options) |
Generates preview images of specific pages in a given image format. |
get_document_info(self) |
Gets the general information about the document - size, page count, etc. |
Remarks
Learn more | | | |
Example
The following example demonstrates applying a single redaction to the document.
The following example demonstrates applying a list of redactions to the document.
The following example demonstrates how to apply a redaction policy to all files within a given inbound folder, and save to one of outbound folders - for successfully updated files and for failed ones.
The following example demonstrates how to open a password-protected documents using LoadOptions.
The following example demonstrates how to save a document using SaveOptions.
See Also
- module
groupdocs.redaction - class
IPreviewable - class
Redactor