fix(bug):修复转换PDF功能BUG,优化园长签名生成逻辑,让更多的文档支持园长签名功能

This commit is contained in:
2026-01-24 23:38:38 +08:00
parent f3d16ec1f9
commit de71594812
8 changed files with 118 additions and 51 deletions

View File

@@ -100,14 +100,18 @@ def replace_text_in_slide(prs, slide_index, placeholder, text):
try:
run.font.space = original_font["character_space"]
except:
logger.error(f"错误: 无法设置字体间距 {original_font['character_space']}")
logger.error(
f"错误: 无法设置字体间距 {original_font['character_space']}"
)
if original_font["color"]:
try:
if hasattr(original_font["color"], "rgb"):
run.font.color.rgb = original_font["color"].rgb
except:
logger.error(f"错误: 无法设置字体颜色 {original_font['color']}")
logger.error(
f"错误: 无法设置字体颜色 {original_font['color']}"
)
def replace_picture(prs, slide_index, placeholder, img_path):
@@ -138,6 +142,10 @@ def replace_picture(prs, slide_index, placeholder, img_path):
break
if target_shape:
logger.debug(f"找到占位符 {placeholder},索引 {target_index}")
logger.debug(
f"占位符位置: 左 {target_shape.left}, 上 {target_shape.top}, 宽 {target_shape.width}, 高 {target_shape.height}"
)
# 获取原位置信息
left, top, width, height = (
target_shape.left,