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

I saw http://www.perlmonks.org/?node_id=491983 where he show how to use Win32::OLE to save a powerpoint as DOC.

How would I save a single slide as PNG?

s/te/ve/

Replies are listed 'Best First'.
Re: Save Powerpoint Slide as PNG?
by desemondo (Hermit) on Feb 12, 2010 at 09:04 UTC
    It looks as though that code is highly geared towards extracting the content of powerpoint files and then manipulating them into Word. I could be wrong, but it sounds like it is of limited use for what you want to do.

    From what I've read (ie. Untested), Powerpoint itself should be capable of exporting slides as images (definitely jpeg, and maybe png also.)

    Take a look at Win32::PowerPoint.
    On its own it won't be enough, but, you may be able to figure out how it interacts with PowerPoint through Win32::OLE in order to build your own module/code to simply "Save As" your powerpoint files as images. Then discard the slide images you don't need and keep the ones you want...

    best of luck with it.
Re: Save Powerpoint Slide as PNG?
by zentara (Cardinal) on Feb 12, 2010 at 12:34 UTC
    You might like to look at Convert PowerPoint Presentation to Word Document with Win32::OLE. Once in Word, you probably can export the page as an image.

    As a fast (or last :-) ) solution, you could use ImageMagick's import, or some other win32 screenshot program to grab a fast screenshot. The way import works, is you execute import, then a little crosshair appears as the mouse pointer, which you click in the window you wish to save....all very easy if you just want a few images.


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku
        Oops, his node link is broken, and I didn't notice the node id being the same. I still think that is his best bet, even the current last node on that page Re^3: Convert PowerPoint Presentation to Word Document with Win32::OLE seems to discuss exporting.

        I don't use MSWindows, but most word processors can export photos of whole pages.

        If you google for "export word to png" you will find instructions. (The MS help website wouldn't let me see the page because I didn't have activeX or some similar MS b*llshit.) Linux rules! :-)


        I'm not really a human, but I play one on earth.
        Old Perl Programmer Haiku