MetadataSearchRedaction class
Leave feedback
On this page
Represents a metadata redaction that searches and redacts metadata using regular expressions, matching keys and/or values.
- More details about applying redactions: https://docs.groupdocs.com/redaction/net/redaction-basics/
- More details about document metadata redactions: https://docs.groupdocs.com/redaction/net/metadata-redactions/
The MetadataSearchRedaction type exposes the following members:
| Constructor | Description |
|---|---|
| init | Initializes a new instance of MetadataSearchRedaction class, using value to match redacted items. |
| init | Initializes a new instance of MetadataSearchRedaction, using item name and value to match redacted items. |
| init | Initializes a new instance of MetadataSearchRedaction class, using value to match redacted items. |
| init | Initializes a new instance of MetadataSearchRedaction using item name and value to match redacted items. |
| Method | Description |
|---|---|
| apply_to | Applies the redaction to a given format instance. (inherited from MetadataRedaction) |
| apply_to_document_format_instance | (inherited from MetadataRedaction) |
| Property | Description |
|---|---|
| description | The description of the redaction, containing its name and parameters. |
| key_expression | The regular expression to match the name (key) of a metadata item. |
| replacement | The textual replacement value. |
| value_expression | The regular expression to match the value text of a metadata item. |
| filter | The filter used to select all or specific metadata, such as Author or Company. (inherited from MetadataRedaction) |
from groupdocs.redaction import Redactor
from groupdocs.redaction.redactions import MetadataSearchRedaction, MetadataFilters
with Redactor("document.docx") as redactor:
# Redact any metadata value matching the pattern
redaction = MetadataSearchRedaction("Company Ltd.", "--company--")
redaction.filter = MetadataFilters.COMPANY
redactor.apply(redaction)
redactor.save()
Task guides that use MetadataSearchRedaction:
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.