EraseMetadataRedaction
Leave feedback
On this page
Represents a metadata redaction that erases all metadata or metadata matching specific MetadataFilters from the document.
public class EraseMetadataRedaction : MetadataRedaction
| Name | Description |
|---|---|
| EraseMetadataRedaction() | Initializes a new instance of EraseMetadataRedaction class, erasing all metadata. |
| EraseMetadataRedaction(MetadataFilters) | Initializes a new instance of EraseMetadataRedaction class, erasing metadata, matching specific combination of MetadataFilters. |
| Name | Description |
|---|---|
| override Description { get; } | Returns a string, describing the redaction and its parameters. |
| Filter { get; set; } | Gets or sets the filter, which is used to select all or specific metadata, for example Author or Company. |
| Name | Description |
|---|---|
| override ApplyTo(DocumentFormatInstance) | Applies the redaction to a given format instance. |
Learn more
- More details about applying redactions: Redaction basics
- More details about document metadata redactions: Metadata redactions
The following example demonstrates how to erase (set equal to empty values) all or specific metadata.
using (Redactor redactor = new Redactor(@"C:\sample.docx"))
{
// Erase Author, Manager and Company
redactor.Apply(new EraseMetadataRedaction(MetadataFilters.Author | MetadataFilters.Manager | MetadataFilters.Company));
// Erase all metadata
redactor.Apply(new EraseMetadataRedaction(MetadataFilters.All));
redactor.Save();
}
- class MetadataRedaction
- namespace GroupDocs.Redaction.Redactions
- assembly 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.