1
votes

PowerPoint has an option of saving the file in other formats. Using this feature one can convert the slides into images.

I want to develop an application where one can upload a .ppt file into my server and the application would convert the slides into images, without any manual intervention.

Could I have any pointers- how to do so?

Thanks in advance.

4
Here is an example in PowerShell, hope this helps: github.com/utapyngo/pptrasterizer/blob/master/ppt_rasterize.ps1utapyngo

4 Answers

2
votes

Microsoft recommends against and doesn't support using Office automation on the server. That said, it can certainly be done. You have to understand that PowerPoint only allows one instance of itself at a time; you'll want to write your app such that you're not trying to invoke multiple instances of PPT.

One approach is to write a "watcher" app that polls a directory for PPT files every n minutes. When it finds them, it launches PowerPoint, loads the files one at a time and for each file, does the export, then closes the file. When all files are done, it dismisses PowerPoint, then goes back to waiting for more files to appear.

1
votes

Since PowerPoint is a Microsoft technology, I would definitely go for a Microsoft solution.

You could use Fluorine to set up a remoting service in C# and do the converting server-side.

Here is an article on how to extract slides from .ppt files in C#:

I am sure there are other ways to achieve this but this seems the most pragmatic way of doing it.

Cheers

0
votes

You may try Aspose.Slides for .NET to convert the PPT/PPTX slides to images. This component doesn't require MS Office installed on the server and it can be used just like any other .NET assembly. It can work on any Windows OS in 32/64-bit environment seamlessly.

Disclosure: I work as developer evangelist at Aspose.

0
votes

I tried ASPOSE and indeed it works fine. The problem is the outrageous cost of licensing for ASPOSE. They simply don't care for the little guy who has an idea and wants to test it out, or even a small company. They charge their license fees based on the number of devs on the company.

Given that Microsoft doesn't provide a real solution and alternative (COM automation is very crappy and a huge memory leak) we had to use OpenXML.

It "gets the job done", but it is probably one of the most rigid and unfriendly libraries but it didn't have the same cost as ASPOSE.

Microsoft should put a little bit of love into OpenXML libraries. That would definitively give an extra edge to the Office development community. (at least those that are not using anything that SharePoint supports)