墨消しとは、電子文書から不要な情報や機密情報を削除することです。 PDF、DOC、DOCX、PPT、PPTX、XLS、XLSXなどを含むすべてのファイル形式には、いくつかのメタデータプロパティがあります。これらのプロパティには、作成者名、カテゴリ、会社名、コメント、作成時間、最終更新日などが含まれます。不要なメタデータフィールドを完全に削除する必要がある場合や、値を更新したい場合があります。さまざまなツールや手法を使用して表示できるファイルに関連付けられた隠しデータもいくつかあります。このデータに誰もアクセスしたくない場合が多くあります。 GroupDocs.Redaction APIを使用すると、これらのメタデータプロパティのいずれかにメタデータ編集を適用できます。必要なメタデータをフィルタリングすることで、それらを変更または削除できます。このガイドでは、JavaのRTFメタデータから作成者名を編集する方法について説明します。
次のコードを使用すると、RTFドキュメントから機密データを検索して編集できます。フィルタを設定することで、編集の範囲を設定できます。 MetadataFilter.Authorに。 「Author」プロパティを除くすべてのメタデータアイテムで、正規表現の一致が取り消されたままになります。
EraseMetadataRedactionクラスを使用して、ドキュメント内のすべてまたは特定のメタデータを空の(空白または最小の)値に置き換えることができます。次のコードは、RTFドキュメントからメタデータプロパティをフィルタリングして削除する方法を示しています。次の例では、ドキュメントのすべてのプロパティが空白になっています。
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 APIは、すべての主要なプラットフォームとオペレーティングシステムでサポートされています。完全なシステム要件ガイドについては、システム要件にアクセスしてください。以下のコードを実行する前に、システムに次の前提条件がインストールされていることを確認してください。 :
Introduced and documented by Microsoft, the Rich Text Format (RTF) represents a method of encoding formatted text and graphics for use within applications. The format facilitates cross-platform document exchange with other Microsoft Products, thus serving the purpose of interoperability. This capability makes it a standard of data transfer between word processing software and, hence, contents can be transferred from one operating system to another without losing document formatting. The file format specifications are available by Microsoft for public download and can be referred to from developer’s perspective.
Read More(Bitmap Image File)
(Microsoft Word Binary Format)
(Microsoft Word 2007 Marco File)
(Office 2007+ Word Document)
(Microsoft Word Template Files)
(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)
(Tagged Image File Format)
(Microsoft Excel Spreadsheet (Legacy))
(Macro-enabled Spreadsheet)
(Open XML Workbook)
(Excel 97 - 2003 Template)
(Excel Macro-Enabled Template)
(Excel Template)