# -*- coding: utf-8 -*-
"""Export slides to PNG via PowerPoint COM."""
import os, sys
import win32com.client

src = r"C:\laragon\www\worker-system\ai-image-ppt\AI文字生圖入門教學.pptx"
dst = r"C:\laragon\www\worker-system\ai-image-ppt\png"
os.makedirs(dst, exist_ok=True)

app = win32com.client.Dispatch("PowerPoint.Application")
pres = app.Presentations.Open(src, ReadOnly=True, WithWindow=False)
pres.SaveAs(dst, 18)  # ppSaveAsPNG
pres.Close()
app.Quit()
print("exported to", dst)
