anon
anon

Reputation:

Save PPS/PPT files as SWF using C#

I want to build a C# application that save a pps\ppt file as SWF. For saving pps\ppt as image I use this code:

Application apps = new Application();
Presentations pps = apps.Presentations;

    foreach (string file in Directory.GetFiles("[here is a path]", "*.ppt"))
    {
          try
          {
          Presentation p = pps.Open(file, MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);
          p.SaveAs("[here is a path]" + p.Name, PpSaveAsFileType.ppSaveAsJPG); //It saves the slides as images in a folder.
          Console.WriteLine(id.ToString() + ". " + p.Name);
          p.Close();
          id++;
          }
          catch{ }
    }

So, how can I save the pps\ppt files from a folder as SWF? There isn't this: PpSaveAsFileType.ppSaveAsSWF

Upvotes: 0

Views: 849

Answers (2)

MarkV
MarkV

Reputation: 26

You need to convert PPT files with some third-party software that has a C# API. I use print2flash for this purpose. The core conversion code I use is quite simple if I omit some options from my real C# application

Print2Flash4.Server2 serv = new Print2Flash4.Server2();
Print2Flash4.Profile2 prof = new Print2Flash4.Profile2();
prof.DocumentType = Print2Flash4.DOCUMENT_TYPE.FLASH;
serv.ConvertFile(inputfile, swf_file, prof, null, null);

To use this code, you need to get Interop.Print2Flash4.dll as well. You may get the dll and further instructions from the sdk available for download from http://print2flash.com/download.php

Upvotes: 0

Fabio
Fabio

Reputation: 990

No you can't using PowerPoint API.

To convert PowerPoint files to Flash you have look for software vendors that sell specific API to do that.

Anyway, not all PowerPoint objects/features are supported so you could lose some kind of contents.

Of course it can be done if you develop an application by your self but you need strong knoledge of PowerPoint API and Flash accessing pptx (openxml) files from Flash... it's a job.

Upvotes: 1

Related Questions