PHPePub\Core\EPub::setViewport PHP Method

setViewport() public method

Calling this function without arguments clears the viewport. The predefined viewports can be accessed with $this->viewportMap
public setViewport ( integer | string $width = null, integer $height = null )
$width integer | string integer for the width, or a string referencing an entry in the $viewportMap.
$height integer
    public function setViewport($width = null, $height = null)
    {
        if ($width == null) {
            unset($this->viewport);
        }
        if (is_string($width) && in_array($width, $this->viewportMap)) {
            $vp = $this->viewportMap[$width];
            $width = $vp['width'];
            $height = $vp['height'];
        }
        $this->viewport = array('width' => $width, 'height' => $height);
    }