PHPOffice / PHPPresentation

A pure PHP library for reading and writing presentations documents
https://phpoffice.github.io/PHPPresentation
Other
1.31k stars 521 forks source link

getAnimations always return empty array #549

Open bellu opened 5 years ago

bellu commented 5 years ago

I'm trying to retrieve the animations of a slide, but using the method getAnimations() i had always an empty array.

I've tried different files and different slides, without success.

Progi1984 commented 5 years ago

@bellu Is it in reading ?

Could you give me a sample file :)

bellu commented 5 years ago

test2.pptx

Yes, is in reading. I've passed the sample file (it's just a sample from the web that i'm using to do some experiments). Here my full code ( i'm using Laravel):

        $fileName = 'ppt/test2.pptx';
        $pptPath = \Storage::disk('local')->path($fileName);
        $pptReader = IOFactory::createReader('PowerPoint2007');
        $oPHPPresentation = $pptReader->load($pptPath);
        $slide = $oPHPPresentation->getSlide(12);
        dd($slide->getAnimations());

getAnimations() return always an empty array.