Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Does Perl have any module that converts .ppt(power point) files to .html files. I am not sure that such a module does exist or not . Thankyou !
  • Comment on Perl module for converting .ppt file to html

Replies are listed 'Best First'.
Re: Perl module for converting .ppt file to html
by Corion (Patriarch) on Nov 28, 2003 at 08:17 UTC

    Searching this site for ppt returns a lot of hits on automating PowerPoint. There have been two other nodes discussing similar problems with Office Automation recently.

    perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
Re: Perl module for converting .ppt file to html
by chanio (Priest) on Nov 28, 2003 at 14:01 UTC
    I would search for something related to http://www.openoffice.org/ . It always read .ppt files and quite well. They should now be converting those files to some XML source.
Re: Perl module for converting .ppt file to html
by simonm (Vicar) on Nov 28, 2003 at 07:15 UTC
    I've looked around a bit in the past, and haven't found such a module. I've heard of some other tools to convert PPT files to standard formats like PostScript, but the ones I found all seemed to be quite out of date...
      But why bother? You can simply open the PPT up in PowerPoint, and save it as HTML. But I hate the ugly HTML it generates. :-(.

      Or with my favorite method - screen grab the powerpoint slides as a bunch of JPG or PNG, and then create a thumbnail listing page to index to the JPG's. Works everytime. ;-)

        Interestingly MS-Excel has an export method that can save charts into graphics file-formats. I couldn't see an equivalent while flipping through the PowerPoint object model, but I did come across this code snippet:

        Private Sub App_PresentationSave(ByVal Pres As Presentation) With Pres.PublishObjects(1) PresName = .SlideShowName .SourceType = ppPublishAll .FileName = "C:\HTMLPres\mallard.htm" .HTMLVersion = ppHTMLVersion4 MsgBox ("Saving presentation " & "'" _ & PresName & "'" & " in PowerPoint" _ & Chr(10) & Chr(13) _ & " format and HTML version 4.0 format") .Publish End With End Sub

        This should save a file as both PowerPoint and HTML formats. You could implement this stub in Win32::OLE, if you can put up with the (very) low quality HTML MS-Office emits

        screen grab the powerpoint slides as a bunch of JPG or PNG

        Assuming you have access to powerpoint you can also use the File->Save as...-> and then select file type gif, jpg or png and then you can save all slides as gif, jpg or png files. Depending on powerpoint version, I may need to modify your presentation slide sizes so that you get the appropriate image size.

        But why bother? You can simply open the PPT up in PowerPoint, and save it as HTML.

        Well, one good reason might be that the files are on a machine that doesn't have PowerPoint installed, such as a Unix-based web server that's trying to provide preview thumbnails for files that have been uploaded. (That's why I went looking...)