使用 Python 对 ODP 演示文稿中的文本进行脱敏
借助 Aspose.Slides 构建在演示文稿中查找并替换敏感文本的 Python 应用程序。
使用 Python 对 ODP 演示文稿中的文本脱敏
借助
Aspose.Slides for Python via .NET
,您可以替换整个 ODP 演示文稿中的敏感文本。将 Presentation.replace_text 与 TextSearchOptions 结合使用来控制搜索,然后保存修改后的演示文稿。
对 ODP 演示文稿中的文本进行脱敏 – Python
search_options = slides.TextSearchOptions()
search_options.whole_words_only = True
search_options.include_notes = True
with slides.Presentation("presentation.odp") as presentation:
presentation.replace_text("Confidential", "[REDACTED]", search_options, None)
presentation.save("redacted-presentation.odp", slides.export.SaveFormat.ODP)如何使用 Python 对 ODP 演示文稿中的文本进行脱敏
按照以下步骤替换 ODP 演示文稿中的敏感文本。
- 使用
Presentation打开 ODP 文件。 - 将
Presentation.replace_text与TextSearchOptions结合使用,替换所需文本。 - 使用
SaveFormat.ODP保存修改后的演示文稿。
基于 Aspose.Slides 构建
在线对 ODP 文件进行脱敏
免费的 Aspose.Slides Redaction 应用基于 Aspose.Slides for Python via .NET 构建,与上方代码使用的是同一 API。打开它,看看 API 能如何处理您自己的 ODP 文件。
- 在浏览器中运行,无需安装任何软件。
- 在编写代码之前,了解 Aspose.Slides 如何查找和替换文本。
- 在您的 ODP 文件中查找和替换文本,支持正则表达式。
- 下载脱敏后的文件。
其他支持脱敏的格式
使用 Python 对其他受支持的演示文稿格式中的文本进行脱敏。