PhpOffice\PhpPresentation\PhpPresentation::setZoom PHP Method

setZoom() public method

Set the zoom of the document (in percentage)
Deprecation: for getPresentationProperties()->setZoom()
public setZoom ( float $zoom = 1 ) : PhpPresentation
$zoom float
return PhpPresentation
    public function setZoom($zoom = 1)
    {
        return $this->getPresentationProperties()->setZoom($zoom);
    }

Usage Example

 /**
  * Read View Properties
  * @param string $sPart
  */
 protected function loadViewProperties($sPart)
 {
     $xmlReader = new XMLReader();
     if ($xmlReader->getDomFromString($sPart)) {
         $pathZoom = '/p:viewPr/p:slideViewPr/p:cSldViewPr/p:cViewPr/p:scale/a:sx';
         if (is_object($oElement = $xmlReader->getElement($pathZoom))) {
             if ($oElement->hasAttribute('d') && $oElement->hasAttribute('n')) {
                 $this->oPhpPresentation->setZoom($oElement->getAttribute('n') / $oElement->getAttribute('d'));
             }
         }
     }
 }
All Usage Examples Of PhpOffice\PhpPresentation\PhpPresentation::setZoom