How to read a .ppt file using PHPPowerPoint library?

  • maybe not at all, because ppt is binary, not openxml (for which PHPPowerPoint is intended in the first place) - LamerXaKer
  • How then can you read ppt / pptx? - asd

1 answer 1

Try using PHPPresentation .

use PhpOffice\PhpPresentation\IOFactory; $pptFile = '/path/to/file.ppt'; $pptReader = IOFactory::createReader('PowerPoint97'); $presentation = $pptReader->load($pptFile); foreach ($presentation->getAllSlides() as $slide) { foreach ($slide->getShapeCollection() as $shape) { var_dump($shape); } } 

For more details on how to parse the shape object, see here .

  • I downloaded the archive, the PhpPresentation-develop folder, extracted it into the root of the directory, created the index.php file and pasted the contents of your code. Displays Fatal error: Class 'PhpOffice \ PhpPresentation \ IOFactory' not found in C: \ xampp \ htdocs \ index.php on line 5 - asd
  • one
    Read carefully the documentation, it says how to use it correctly. - Andrei Katalkin