.NET コアアプリの C# と正規表現を使用して RTF ファイルをサニタイズする

Office および OpenOffice のドキュメント、スプレッドシート、プレゼンテーション、および Windows、Linux、macOS 上の RTF から機密情報を検索して削除します


.NET API のドキュメント テキストの秘匿化

メタデータの変更やコメントの削除機能を含む、PDF、Word、Excel、PowerPoint のドキュメントおよび画像からの機密情報や機密情報をサニタイズするための、形式に依存しない単一のインターフェイス。 GroupDocs.Redaction for .NET ツールを使用すると、機密情報を編集して編集した文書を PDF に保存し、すべてのページをラスター イメージに変換したり、文書を元の形式で保存してさらに編集したりできます。

C# 経由の正規表現を使用して RTF からのテキストを秘匿化する

GroupDocs.Redaction を使用すると、.NET 開発者は正規表現の最大限の強度を使用して、いくつかの簡単な手順で RTF ファイルを秘匿化できます。

  • Redactor クラスのインスタンスを作成し、RTF ファイルをロードします
  • RegexRedaction クラスのインスタンスを作成して、テキストを検索して置換します
  • RegexRedaction のオブジェクトを使用して Redactor.Apply メソッドを呼び出す

リダクション API を使ってみる

コマンドラインから nuget install GroupDocs.Redaction としてインストールするか、Visual Studio のパッケージ マネージャー コンソールから Install-Package GroupDocs.Redaction を使用してインストールします。 あるいは、ダウンロード からオフライン MSI インストーラーまたは ZIP ファイル内の DLL を取得し、プロジェクト内で手動で参照します。

using (Redactor redactor = new Redactor(@"sample.rtf"))
{
	redactor.Apply(new RegexRedaction("\\d{2}\\s*\\d{2}[^\\d]*\\d{6}", new ReplacementOptions(System.Drawing.Color.Blue)));
	redactor.Save();
}

RTF Ja Live Demo

Checkout the free online demo for RTF Ja.

No need to set up

No need to write any code

Just upload the source file

Get the download link

What is RTF File Format?

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

Other Ja Options

CSV Ja

(Comma Seperated Values)

DOC Ja

(Microsoft Word Binary Format)

DOCM Ja

(Microsoft Word 2007 Marco File)

DOCX Ja

(Office 2007+ Word Document)

DOT Ja

(Microsoft Word Template Files)

DOTM Ja

(Microsoft Word 2007+ Template File)

DOTX Ja

(Microsoft Word Template File )

PDF Ja

(Portable Document Format)

POT Ja

(Microsoft PowerPoint Template Files)

POTM Ja

(Microsoft PowerPoint Template File)

PPS Ja

(PowerPoint Slide Show)

PPSM Ja

(Macro-enabled Slide Show)

PPSX Ja

(PowerPoint Slide Show)

PPT Ja

(Microsoft PowerPoint 97-2003)

PPTM Ja

(Macro-enabled Presentation File)

PPTX Ja

(Open XML presentation Format)

XLS Ja

(Microsoft Excel Spreadsheet (Legacy))

XLSM Ja

(Macro-enabled Spreadsheet)

XLSX Ja

(Open XML Workbook)

XLT Ja

(Excel 97 - 2003 Template)

XLTM Ja

(Excel Macro-Enabled Template)

XLTX Ja

(Excel Template)

Back to top
 日本