0

I want to export a ppt slide as an png format image through pptx python.

I have gone through this solution using win32com but facing error as com_error: (-2147221005, 'Invalid class string', None, None) while running win32com.client.Dispatch("PowerPoint.Application")

I have also tried using pptx_tools.utils.save_pptx_as_png, but it is asking Comptype module needed to save PNGs. and I don't find any comptype module in Python. I have installed comtype module but it is throwing an syntax error while importing.

Please let me know any efficient way to export pptx slide as image

Abdul Quddus
  • 111
  • 2
  • 10

2 Answers2

0

As you've tagged this with "python-pptx" I have to tell you python-pptx can't do it.

You'd have to do it by automating the Powerpoint application itself. (Sorry, I don't know how to do that.)

Martin Packer
  • 648
  • 4
  • 12
0

After I try many times, I corrected some places and it runs fine:

  1. Import module: import win32com.client

  2. Your path 1 (pptx file): "/ddd/xxx/yyy/file.pptx"

  3. Your path 2 (output file): "/ddd/xxx/yyy/file.jpg"

funie200
  • 3,688
  • 5
  • 21
  • 34