ions($options); } return $this; } /** * @return Options */ public function getOptions() { return $this->options; } /** * @return array * @deprecated */ public function get_callbacks() { return $this->getCallbacks(); } /** * Returns the callbacks array * * @return array */ public function getCallbacks() { return $this->callbacks; } /** * @param array $callbacks the set of callbacks to set * @return $this * @deprecated */ public function set_callbacks($callbacks) { return $this->setCallbacks($callbacks); } /** * Define callbacks that allow modifying the document during render. * * The callbacks array should contain arrays with `event` set to a callback * event name and `f` set to a function or any other callable. * * The available callback events are: * * `begin_page_reflow`: called before page reflow * * `begin_frame`: called before a frame is rendered * * `end_frame`: called after frame rendering is complete * * `begin_page_render`: called before a page is rendered * * `end_page_render`: called after page rendering is complete * * `end_document`: called for every page after rendering is complete * * The function `f` receives three arguments `Frame $frame`, `Canvas $canvas`, * and `FontMetrics $fontMetrics` for all events but `end_document`. For * `end_document`, the function receives four arguments `int $pageNumber`, * `int $pageCount`, `Canvas $canvas`, and `FontMetrics $fontMetrics` instead. * * @param array $callbacks The set of callbacks to set. * @return $this */ public function setCallbacks(array $callbacks): self { $this->callbacks = []; foreach ($callbacks as $c) { if (is_array($c) && isset($c["event"]) && isset($c["f"])) { $event = $c["event"]; $f = $c["f"]; if (is_string($event) && is_callable($f)) { $this->callbacks[$event][] = $f; } } } return $this; } /** * @return boolean * @deprecated */ public function get_quirksmode() { return $this->getQuirksmode(); } /** * Get the quirks mode * * @return boolean true if quirks mode is active */ public function getQuirksmode() { return $this->quirksmode; } /** * @param FontMetrics $fontMetrics * @return $this */ public function setFontMetrics(FontMetrics $fontMetrics) { $this->fontMetrics = $fontMetrics; return $this; } /** * @return FontMetrics */ public function getFontMetrics() { return $this->fontMetrics; } /** * PHP5 overloaded getter * Along with {@link Dompdf::__set()} __get() provides access to all * properties directly. Typically __get() is not called directly outside * of this class. * * @param string $prop * * @throws Exception * @return mixed */ function __get($prop) { switch ($prop) { case 'version': return $this->version; default: throw new Exception('Invalid property: ' . $prop); } } }