How to create a set of image files from a PowerPoint file?

I am creating a slideshow web page. A user will upload a PowerPoint file, which my server will use to create a set of .jpg image files that represent slides for presentation in a custom β€œgallery viewer”.

I am an experienced Python developer, but cannot find anything useful.

How can i do this?

+4
source share
3 answers

Apache POI and Jython. The POI even has an ImageExtractor class, but just by looking at the Javadocs I suspect it is incomplete.

0
source

Above my head, how would I do it:

  • Use OpenOffice.org to convert a .ppt file to a PDF file. (OO.o has a very rich Java API. Rich and bloody, difficult to use, a mind, but as soon as you figure out how to get it to do the task you need, you're all set up. I don't know if you can do anything useful with using this via Python, not my language.)
  • Use ImageMagick to convert PDF to .jpg files. (Although I was told that converting a PDF to a PS file before turning it into images gives better results.) (The IM command line interface is damned for the language for yourself - although again, when you figure out how to get it, do that if you want, you're done.)

It is unbelievable if this is the most efficient / reliable way to do this. But basically, I would go to Google trolling for third-party open source tools that do all the dirty work for me.

+4
source

Are you doing this on windows? If so win32 com:

import win32com.client Application = win32com.client.Dispatch("PowerPoint.Application") Application.Visible = True Presentation = Application.Presentations.Open(pathToPPT) Presentation.Slides[1].Export("C:/path/to/jpg.jpg", "JPG", 800, 600); etc... 
0
source

Source: https://habr.com/ru/post/1303473/


All Articles