Saving the document in an original format requires deleting or redacting its metadata to remove all confidential data. For these purposes GroupDocs.Redaction provides metadata redaction API. GroupDocs.Redaction API allows to either save redacted documents in PDF, transform all pages into raster images or save redacted document in its original format for further editing. 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.There are also some hidden data associated with the files which can be viewed using various tools and techniques. 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 Version metadata from DOT document in Java.
Following code allows you to search and redact sensitive data from a DOT document. You can set scope for redaction by setting filter, e.g. to MetadataFilter.Version. It will leave the regular expressions matches undone in all metadata items, except “Version” property:
final Redactor redactor = new Redactor(filePath); | |
try | |
{ | |
MetadataSearchRedaction redaction = new MetadataSearchRedaction("version number", "--version--"); | |
redaction.setFilter(MetadataFilters.Version); | |
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(); } |
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 DOT document.The example below blanks out all properties of the document:
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(); } |
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:
Files with .DOT extension are template files created by Microsoft Word to have pre-formatted settings for generation of further DOC or DOCX files. A template file is created in order to have specific user settings that should be applied to subsequent files created from these. These settings include page margins, borders, headers, footers, and other page settings. Such templates are used in official documents such as company letterheads and standardized forms. The DOT file format is specific to Microsoft Word 2003 and earlier, but is supported by higher versions as well. Microsoft Word by default opens every new document based on normal.dot file. If modified, all the new files created will result in same settings as from the template file. In Microsoft Word 2007, the DOT file format has been replaced with Office OpenXML based DOTX file format.
Read More(Bitmap Image File)
(Microsoft Word Binary Format)
(Microsoft Word 2007 Marco File)
(Office 2007+ Word Document)
(Microsoft Word 2007+ Template File)
(Microsoft Word Template File )
(Graphical Interchange Format)
(Joint Photographic Expert Group Image)
(Portable Document Format)
(Portable Network Graphic)
(Microsoft PowerPoint Template Files)
(Microsoft PowerPoint Template File)
(PowerPoint Slide Show)
(Macro-enabled Slide Show)
(PowerPoint Slide Show)
(Microsoft PowerPoint 97-2003)
(Macro-enabled Presentation File)
(Open XML presentation Format)
(Rich Text Format)
(Tagged Image File Format)
(Microsoft Excel Spreadsheet (Legacy))
(Macro-enabled Spreadsheet)
(Open XML Workbook)
(Excel 97 - 2003 Template)
(Excel Macro-Enabled Template)
(Excel Template)