fix:修复一些BUG

This commit is contained in:
2025-12-13 19:44:27 +08:00
parent 9d347f9bc9
commit 93d1e8687a
18 changed files with 584 additions and 638 deletions

View File

@@ -1,5 +1,5 @@
import os
import pythoncom
import comtypes.client
@@ -9,6 +9,8 @@ def ppt_to_pdf_single(ppt_path, pdf_path=None):
:param ppt_path: PPT 文件路径
:param pdf_path: PDF 输出路径 (可选,默认同名)
"""
# 子线程初始化 COM 组件
pythoncom.CoInitialize()
ppt_path = os.path.abspath(ppt_path) # COM 接口必须使用绝对路径
if pdf_path is None:
@@ -40,3 +42,4 @@ def ppt_to_pdf_single(ppt_path, pdf_path=None):
finally:
if powerpoint:
powerpoint.Quit()
pythoncom.CoUninitialize()