Class EraseMetadataRedaction

  • public class EraseMetadataRedaction
    extends MetadataRedaction

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

    Learn more

    The following example demonstrates how to erase (set equal to empty values) all or specific metadata.

    try (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));;
    • Constructor Detail

      • EraseMetadataRedaction

        public EraseMetadataRedaction()

        Initializes a new instance of EraseMetadataRedaction class, erasing all metadata.

      • EraseMetadataRedaction

        public EraseMetadataRedaction(int filter)

        Initializes a new instance of EraseMetadataRedaction class, erasing metadata, matching specific combination of MetadataFilters.

        filter - Filter for metadata to erase
    • Method Detail

      • getDescription

        public String getDescription()

        Returns a string, describing the redaction and its parameters.

        getDescription in class Redaction
        Text, containing redaction name and parameters.
      • isApplicableTo

        protected boolean isApplicableTo(MetadataItem item)

        Checks if this redaction could be applied to a given metadata item.

        Specified by:
        isApplicableTo in class MetadataRedaction
        item - Metadata item
        True if redaction can be applied