Remove OR Update Author Name From DOCM Metadata In Java

GroupDocs.Redactions provides a flexible API that allows to search & replace/remove any metadata property using filters.


Download Free Trial

What is Metadata Redaction?

Redaction refers to the removal of unwanted or confidential information from electronic documents. All the file formats including PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX and others have some metadata properties. These properties include author name, category, company name, comments, creation time, last updated and many more. Sometimes you need to completely delete unwanted metadata fields or you might want to update their values. There are also some hidden data associated with the files which can be viewed using various tools and techniques. There are many cases when you don’t want this data to be accessed by anyone. With GroupDocs.Redaction API you can apply metadata redactions to any of these metadata properties. You can change or delete them by filtering the metadata you want. In this guide we will explain how you can redact author name from DOCM metadata in Java.

Redact DOCM Metadata in Java

Following code allows you to search and redact sensitive data from a DOCM document. You can set scope for redaction by setting filter, e.g. to MetadataFilter.Author. It will leave the regular expressions matches undone in all metadata items, except “Author” property:

How to Redact DOCM Metadata

  • Create an instance of Redactor class & upload DOCM file
  • Create an instance of MetadataSearchRedaction class to find and replace sensitive data from document’s metadata
  • Set scope for redaction by setting filter, e.g. Use MetadataFilters.Author in below code
  • Call redactor.save method with object of MetadataSearchRedaction


final Redactor redactor = new Redactor(filePath);
try
{
MetadataSearchRedaction redaction = new MetadataSearchRedaction("Author Name", "--author--");
redaction.setFilter(MetadataFilters.Author);
redactor.apply(redaction);
SaveOptions options = new SaveOptions();
options.setAddSuffix(true);
options.setRasterizeToPDF(false);
// Save the document to "*_Redacted.*" file in original format
redactor.save(options);
}
finally { redactor.close(); }

Remove Author Metadata in Java

You can replace all or specific metadata in the document with empty (blank or minimal) values using EraseMetadataRedaction class. Following code shows how you can filter and then remove a metadata property from a DOCM document.The example below blanks out all properties of the document:

Erase DOCM Metadata

  • Create an instance of Redactor class & upload DOCM file
  • Create an instance of MetadataSearchRedaction class to remove metadata of the document
  • Set scope for redaction by setting filter, e.g. Replace MetadataFilter.All with MetadataFilter.Author in below code
  • Call redactor.save method with object of MetadataSearchRedaction


final Redactor redactor = new Redactor(filePath);
try
{
redactor.apply(new EraseMetadataRedaction(MetadataFilters.All));
SaveOptions options = new SaveOptions();
options.setAddSuffix(true);
options.setRasterizeToPDF(false);
// Save the document to "*_Redacted.*" file in original format
redactor.save(options);
}
finally { redactor.close(); }

System Requirements

GroupDocs.Redaction for Java APIs are supported on all major platforms and operating systems. For complete system requirements guide, please visit system requirements Before executing the code below, please make sure that you have the following prerequisites installled on your system:

  • Operating Systems: Microsoft Windows, Linux, MacOS
  • Development Environment: NetBeans, Intellij IDEA, Eclipse etc
  • Java Runtime Environment: J2SE 6.0 and above
  • Get the latest version of GroupDocs.Redaction for Java from Maven

Why Use GroupDocs.Redaction

  • Allow users to add custom document formats and types of redactions
  • No additional software is required to remove sensitive information
  • Ability to set page range rendering document as PDF
  • Easy way to redact different types of metadata: author name, version, title, subject, description and many more
  • Document information extraction - file type, page count etc.


What is DOCM File Format?

DOCM files are Microsoft Word 2007 or higher generated documents with the ability to run macros. It is similar to DOCX file format but the ability to run macros makes it different from DOCX. Like DOCX, DOCM files can be store text, images, tables, shapes, charts and other contents.The capability to run macros make it easy to save time by executing the series of commands in the form of recorded actions for automatic completion of a task. DOCM files can be opened and edited in Microsoft Word 2007 and above.

Read More

Popular Redaction Options

Redact BMP Files

(Bitmap Image File)

Redact DOC Files

(Microsoft Word Binary Format)

Redact DOCX Files

(Office 2007+ Word Document)

Redact DOT Files

(Microsoft Word Template Files)

Redact DOTM Files

(Microsoft Word 2007+ Template File)

Redact DOTX Files

(Microsoft Word Template File )

Redact GIF Files

(Graphical Interchange Format)

Redact JPEG Files

(Joint Photographic Expert Group Image)

Redact PDF Files

(Portable Document Format)

Redact PNG Files

(Portable Network Graphic)

Redact POT Files

(Microsoft PowerPoint Template Files)

Redact POTM Files

(Microsoft PowerPoint Template File)

Redact PPS Files

(PowerPoint Slide Show)

Redact PPSM Files

(Macro-enabled Slide Show)

Redact PPSX Files

(PowerPoint Slide Show)

Redact PPT Files

(Microsoft PowerPoint 97-2003)

Redact PPTM Files

(Macro-enabled Presentation File)

Redact PPTX Files

(Open XML presentation Format)

Redact RTF Files

(Rich Text Format)

Redact TIFF Files

(Tagged Image File Format)

Redact XLS Files

(Microsoft Excel Spreadsheet (Legacy))

Redact XLSM Files

(Macro-enabled Spreadsheet)

Redact XLSX Files

(Open XML Workbook)

Redact XLT Files

(Excel 97 - 2003 Template)

Redact XLTM Files

(Excel Macro-Enabled Template)

Redact XLTX Files

(Excel Template)

Back to top
 English