|
|
|
|
@ -58,7 +58,7 @@ def remove_copyright_images(pptx_path, copyright_image_paths):
|
|
|
|
|
# 定义要替换的关键字数组
|
|
|
|
|
replace_text_keywords = ["第一PPT"]
|
|
|
|
|
# 定义要删除的关键字符数组
|
|
|
|
|
del_text_keywords = ["Speaker name and title", "OfficePLUS", "Presenter name", "www.officeplus.cn"]
|
|
|
|
|
del_text_keywords = ["Speaker name and title", "OfficePLUS", "Presenter name", "www.officeplus.cn", "第一PPT模板网-WWW.1PPT.COM"]
|
|
|
|
|
|
|
|
|
|
# 遍历每一页幻灯片
|
|
|
|
|
for index, slide in enumerate(prs.slides):
|
|
|
|
|
@ -145,6 +145,10 @@ def process_ppt_files(directory):
|
|
|
|
|
|
|
|
|
|
# 遍历指定目录下的所有文件
|
|
|
|
|
for filename in os.listdir(directory):
|
|
|
|
|
# 过滤掉以 ~$ 开头的文件
|
|
|
|
|
if filename.startswith('~$'):
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
if filename.lower().endswith(('.pptx', '.ppt')): # 只处理 pptx 和 ppt 文件
|
|
|
|
|
pptx_file_path = os.path.join(directory, filename)
|
|
|
|
|
remove_copyright_images(pptx_file_path, copyright_image_paths)
|
|
|
|
|
|