GroupDocs.Redaction for Java 21.12 Release Notes

Major Features

There are the following improvements in this release:

  • Add support for custom PDF metadata

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
REDACTIONJAVA-143Add support for custom PDF metadataImprovement
REDACTIONJAVA-157Small-sized plain text documents fail to be recognizedBug

Public API and Backward Incompatible Changes

Add support for custom PDF metadata

This improvement allows users to apply redactions to custom XML metadata within PDF files, including metadata of the embedded image resources.

Public API changes

Method getCategory(), returning ID of the embedded resource, has been added to MetadataItem class.

Usage

The following example demonstrates how to remove strings like “/first.last” (e.g. user name in source file paths) from the embedded images metadata of a PDF file.

Java

            try (Redactor redactor = new Redactor("FileWithEmbeddedImages.pdf"))
            {
                RedactorChangeLog result = redactor.apply(new MetadataSearchRedaction(@"/([^\./]+\.[^/]+)", "/redacted"));
                if (result.getStatus() != RedactionStatus.Failed)
                {
                    redactor.save(new SaveOptions(false, "Redacted"));
                }
            }