为什么将 pptx 保存为 pdf 会导致空白页面?
powerpoint = win32com.client.Dispatch('PowerPoint.Application')
powerpoint.Visible = True
pdf = powerpoint.Presentation.Open("test2.pptx")
pdf.SaveAs("test2", FileFormat = 32)
pdf.Close()
powerpoint.Quit()
我正在尝试使用此代码将 pptx 转换为 PDF。 “test2.pptx”位于同一文件夹中,它不是一个空的演示文稿。我认为 .Open
行有问题,因为当我运行代码时,它会打开一个空演示文稿。
powerpoint = win32com.client.Dispatch('PowerPoint.Application')
powerpoint.Visible = True
pdf = powerpoint.Presentation.Open("test2.pptx")
pdf.SaveAs("test2", FileFormat = 32)
pdf.Close()
powerpoint.Quit()
I'm trying to use this code, to convert a pptx to PDF. The "test2.pptx" is in the same folder and it's not an empty presentation. I think something wrong with the .Open
line because when I run the code it opens an empty presentation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经成功解决了这个问题,这是它的工作代码:
I've managed to solve the problem, here is the working code for it: