通过 .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 文件。

开始使用密文 API

通过命令行“nuget install GroupDocs.Redaction”进行安装,或通过 Visual Studio 的包管理器控制台使用“Install-Package GroupDocs.Redaction”进行安装。 或者,从 下载 获取 ZIP 文件中的离线 MSI 安装程序或 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 Zh Live Demo

Checkout the free online demo for RTF Zh.

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 Zh Options

CSV Zh

(Comma Seperated Values)

DOC Zh

(Microsoft Word Binary Format)

DOCM Zh

(Microsoft Word 2007 Marco File)

DOCX Zh

(Office 2007+ Word Document)

DOT Zh

(Microsoft Word Template Files)

DOTM Zh

(Microsoft Word 2007+ Template File)

DOTX Zh

(Microsoft Word Template File )

PDF Zh

(Portable Document Format)

POT Zh

(Microsoft PowerPoint Template Files)

POTM Zh

(Microsoft PowerPoint Template File)

PPS Zh

(PowerPoint Slide Show)

PPSM Zh

(Macro-enabled Slide Show)

PPSX Zh

(PowerPoint Slide Show)

PPT Zh

(Microsoft PowerPoint 97-2003)

PPTM Zh

(Macro-enabled Presentation File)

PPTX Zh

(Open XML presentation Format)

XLS Zh

(Microsoft Excel Spreadsheet (Legacy))

XLSM Zh

(Macro-enabled Spreadsheet)

XLSX Zh

(Open XML Workbook)

XLT Zh

(Excel 97 - 2003 Template)

XLTM Zh

(Excel Macro-Enabled Template)

XLTX Zh

(Excel Template)

Back to top
 中国人