|
@@ -25,15 +25,15 @@ def find_signature_positions(pdf_path, target_texts=["签字或盖章", "技术
|
|
|
logger.info(f"找到签名位置: 第{i}页, {target} at ({x}, {y})")
|
|
|
|
|
|
# 返回结果:所有"签字或盖章"和"技术支持单位(盖章)"的位置
|
|
|
- if len(positions) == 0 :
|
|
|
+ if len(positions) == 0 or positions == []:
|
|
|
return None
|
|
|
# 返回结果:第二个"签字或盖章"和技术支持单位位置
|
|
|
result = []
|
|
|
if len(positions) >= 2:
|
|
|
result.append(positions[1])
|
|
|
# 第二个出现的位置(索引1)
|
|
|
- elif positions is not None:
|
|
|
- result.append(positions)
|
|
|
+ else:
|
|
|
+ result.append(positions[0])
|
|
|
|
|
|
return result
|
|
|
|