fix:实现配置功能,实现园长一键签名功能

This commit is contained in:
2025-12-19 12:23:00 +08:00
parent 0e47603d23
commit 14b8c19dfe
19 changed files with 307 additions and 107 deletions

View File

@@ -97,7 +97,15 @@ def replace_text_in_slide(prs, slide_index, placeholder, text):
def replace_picture(prs, slide_index, placeholder, img_path):
"""在指定幻灯片中替换指定占位符的图片(包含自动旋转修复)"""
"""
在指定幻灯片中替换指定占位符的图片(包含自动旋转修复)
参数:
prs: Presentation 对象
slide_index: 幻灯片索引 (从0开始)
placeholder: 占位符名称 (例如 "signature")
img_path: 图片路径
"""
if not os.path.exists(img_path):
logger.warning(f"警告: 图片路径不存在 {img_path}")
return
@@ -129,4 +137,4 @@ def replace_picture(prs, slide_index, placeholder, img_path):
new_shape = slide.shapes.add_picture(img_stream, left, top, width, height)
# 5. 恢复层级位置 (z-order)
sp_tree.insert(target_index, new_shape._element)
sp_tree.insert(target_index, new_shape._element)