PhpOffice\PhpPresentation\Reader\PowerPoint2007::load PHP Method

load() public method

Loads PhpPresentation Serialized file
public load ( string $pFilename ) : PhpPresentation
$pFilename string
return 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\\PowerPoint2007: " . $pFilename . ".");
        }
        return $this->loadFile($pFilename);
    }

Usage Example

 public function testZoom()
 {
     $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_12.pptx';
     $object = new PowerPoint2007();
     $oPhpPresentation = $object->load($file);
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $oPhpPresentation);
     $this->assertEquals(1, $oPhpPresentation->getZoom());
     $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/PPTX_Zoom.pptx';
     $object = new PowerPoint2007();
     $oPhpPresentation = $object->load($file);
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $oPhpPresentation);
     $this->assertEquals(2.68, $oPhpPresentation->getZoom());
 }
All Usage Examples Of PhpOffice\PhpPresentation\Reader\PowerPoint2007::load