EraseMetadataRedaction

EraseMetadataRedaction class

Represents a metadata redaction that erases all metadata or metadata matching specific MetadataFilters from the document.

public class EraseMetadataRedaction : MetadataRedaction

Constructors

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.

Properties

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.

Methods

Name Description
override ApplyTo(DocumentFormatInstance) Applies the redaction to a given format instance.

Remarks

Learn more

Examples

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();
}

See Also