public function addBookmark($identifier, $name, $top, $parentIdentifier = null) { try { $destination = \ZendPdf\Destination\FitHorizontally::create($this->getPage(), $top); $action = \ZendPdf\Action\GoToAction::create($destination); //convert from input encoding to UTF-16 $name = iconv($this->encoding, 'UTF-16', $name); $outline = \ZendPdf\Outline\AbstractOutline::create($name, $action); $this->engine->registerOutline($identifier, $outline); $this->addToQueue('doAddBookmark', array($identifier, $outline, $parentIdentifier)); } catch (\ZendPdf\Exception\ExceptionInterface $e) { throw new RuntimeException('Error while bookmark adding', 0, $e); } }
/** * Set outline options * * @param array $options * @return \ZendPdf\Outline\AbstractOutline */ public function setOptions(array $options) { return parent::setOptions($options); }
/** * Add bookmark for current page * * @param string $text Bookmark title * * @return bool Returns TRUE on success or FALSE on failure. */ function add_outline($text) { if (!$this->_page) { $this->_errmsg = "No Page"; return false; } $this->_zpdf->outlines[] = Zend_Pdf_Outline::create($text, Zend_Pdf_Destination_Fit::create($this->_page)); return true; }