查看如何在 Python 中使用 GroupDocs.Watermark 搜索文档、处理多种格式并使用复杂的过滤器。
Python
import groupdocs.watermark as gw
import groupdocs.watermark.search.searchcriteria as gwss
import groupdocs.watermark.options.spreadsheet as gwos
# 设置您的 Python 应用并加载文档
load_options = gwos.SpreadsheetLoadOptions()
with gw.Watermarker("source.xlsx", load_options) as watermarker:
# 定义要查找的水印类型
criteria = gwss.ImageColorHistogramSearchCriteria("watermark.png")
criteria.MaxDifference = 0.5
criteria.bins_count = 2
# 运行搜索并收集水印数据
possible_watermarks = watermarker.search(criteria)
# 使用找到的信息进行进一步操作,如移除或审查
print("Found {0} possible watermark(s).".format(len(possible_watermarks)))