PhpOffice\PhpPresentation\Reader\PowerPoint97::load PHP Метод

load() публичный Метод

Loads PhpPresentation Serialized file
public load ( string $pFilename ) : PhpPresentation
$pFilename string
Результат PhpOffice\PhpPresentation\PhpPresentation
    public function load($pFilename)
    {
        // Unserialize... First make sure the file supports it!
        if (!$this->fileSupportsUnserializePhpPresentation($pFilename)) {
            throw new \Exception("Invalid file format for PhpOffice\\PhpPresentation\\Reader\\PowerPoint97: " . $pFilename . ".");
        }
        return $this->loadFile($pFilename);
    }

Usage Example

Пример #1
0
 public function testLoadFile04()
 {
     $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_04.ppt';
     $object = new PowerPoint97();
     $oPhpPresentation = $object->load($file);
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $oPhpPresentation);
     $this->assertEquals(1, $oPhpPresentation->getSlideCount());
     $oSlide = $oPhpPresentation->getSlide(0);
     $this->assertCount(4, $oSlide->getShapeCollection());
 }
PowerPoint97