renderer = new $rendererName($phpWord); } /** * Magic method to handle direct calls to the configured PDF renderer wrapper class. * * @param string $name Renderer library method name * @param mixed[] $arguments Array of arguments to pass to the renderer method * @return mixed Returned data from the PDF renderer wrapper method * @throws \PhpOffice\PhpWord\Exception\Exception */ public function __call($name, $arguments) { if ($this->renderer === null) { throw new Exception("PDF Rendering library has not been defined."); } return call_user_func_array(array($this->renderer, $name), $arguments); } }