From 5dadde0c61f332fc5bb814d890f4a06bb7b35aee Mon Sep 17 00:00:00 2001 From: nicolaasuni Date: Thu, 23 Jun 2011 17:59:30 +0200 Subject: [PATCH] 5.9.098 --- CHANGELOG.TXT | 3 +++ README.TXT | 2 +- tcpdf.php | 42 +++++++++++++++++++++++++++++++++--------- 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 77793d8..6e85bbe 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,6 @@ +5.9.098 (2011-06-23) + - The Named Destination feature was fixed. + 5.9.097 (2011-06-23) - The method setHtmlVSpace() now can be used also for tags: div, li, br, dt and dd. - The Named Destination feature was added (check the example n. 15) - thanks to Christian Deligant. diff --git a/README.TXT b/README.TXT index 6434dbe..5b5c94f 100755 --- a/README.TXT +++ b/README.TXT @@ -8,7 +8,7 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 5.9.097 +Version: 5.9.098 Release date: 2011-06-23 Author: Nicola Asuni diff --git a/tcpdf.php b/tcpdf.php index 5ffafa6..cd3f06d 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,7 +1,7 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.097 + * @version 5.9.098 */ // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. @@ -146,7 +146,7 @@ require_once(dirname(__FILE__).'/config/tcpdf_config.php'); * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.
* @package com.tecnick.tcpdf * @brief PHP class for generating PDF documents without requiring external extensions. - * @version 5.9.097 + * @version 5.9.098 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -157,7 +157,7 @@ class TCPDF { * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.097'; + private $tcpdf_version = '5.9.098'; // Protected properties @@ -1635,6 +1635,13 @@ class TCPDF { */ protected $dests = array(); + /** + * Object ID for Named Destinations + * @protected + * @since 5.9.097 (2011-06-23) + */ + protected $n_dests; + /** * Directory used for the last SVG image. * @protected @@ -10913,6 +10920,7 @@ class TCPDF { $this->_putspotcolors(); $this->_putshaders(); $this->_putresourcedict(); + $this->_putdests(); $this->_putbookmarks(); $this->_putEmbeddedFiles(); $this->_putannotsobjs(); @@ -10988,11 +10996,7 @@ class TCPDF { } $out .= ' >>'; if (!empty($this->dests)) { - $out .= ' /Dests <<'; - foreach($this->dests as $name => $o) { - $out .= ' /'.$name.' '.sprintf('[%u 0 R /XYZ 0 %.2F null]', $this->page_obj_id[($o['p'])], ($this->pagedim[$o['p']]['h'] - ($o['y'] * $this->k))); - } - $out .= ' >>'; + $out .= ' /Dests '.$this->n_dests.' 0 R'; } $out .= $this->_putviewerpreferences(); if (isset($this->LayoutMode) AND (!$this->empty_string($this->LayoutMode))) { @@ -14652,6 +14656,26 @@ class TCPDF { return $this->dests; } + /** + * Create a javascript PDF string. + * @protected + * @author Johannes Güntert, Nicola Asuni + * @since 5.9.098 (2011-06-23) + */ + protected function _putdests() { + if (empty($this->dests)) { + return; + } + $this->n_dests = $this->_newobj(); + $out = ' <<'; + foreach($this->dests as $name => $o) { + $out .= ' /'.$name.' '.sprintf('[%u 0 R /XYZ 0 %.2F null]', $this->page_obj_id[($o['p'])], ($this->pagedim[$o['p']]['h'] - ($o['y'] * $this->k))); + } + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + } + /** * Adds a bookmark - alias for Bookmark(). * @param $txt (string) Bookmark description.