diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 33d72ae..8526456 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,6 @@ +5.9.193 (2012-09-25) + - Support for named destinations on HTML links was added (i.e.: link to named destination). + 5.9.192 (2012-09-24) - A problem on the releasing process was fixed. diff --git a/README.TXT b/README.TXT index bac8630..ad67259 100755 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 5.9.192 -Release date: 2012-09-24 +Version: 5.9.193 +Release date: 2012-09-25 Author: Nicola Asuni Copyright (c) 2002-2012: diff --git a/composer.json b/composer.json index 007f115..5ea2162 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "tecnick.com/tcpdf", - "version": "5.9.192", + "version": "5.9.193", "homepage": "http://www.tcpdf.org/", "type": "library", "description": "TCPDF is a PHP class for generating PDF documents.", diff --git a/tcpdf.php b/tcpdf.php index 246bf83..ff5d00b 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,9 +1,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.192 + * @version 5.9.193 */ // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. @@ -151,7 +151,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.192 + * @version 5.9.193 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -162,7 +162,7 @@ class TCPDF { * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.192'; + private $tcpdf_version = '5.9.193'; // Protected properties @@ -9797,8 +9797,13 @@ class TCPDF { } case 'link': { if (is_string($pl['txt'])) { - // external URI link - $annots .= ' /A <_datastring($this->unhtmlentities($pl['txt']), $annot_obj_id).'>>'; + if ($pl['txt'][0] == '#') { + // internal destination + $annots .= ' /Dest /'.$this->encodeNameObject(substr($pl['txt'], 1)); + } else { + // external URI link + $annots .= ' /A <_datastring($this->unhtmlentities($pl['txt']), $annot_obj_id).'>>'; + } } else { // internal link if (isset($this->links[$pl['txt']])) { @@ -13960,7 +13965,7 @@ class TCPDF { * @public */ public function addHtmlLink($url, $name, $fill=false, $firstline=false, $color='', $style=-1, $firstblock=false) { - if (!$this->empty_string($url) AND ($url{0} == '#')) { + if (!$this->empty_string($url) AND ($url[0] == '#') AND is_numeric($url[1])) { // convert url to internal link $lnkdata = explode(',', $url); if (isset($lnkdata[0])) { @@ -16766,7 +16771,7 @@ class TCPDF { } /** - * Create a javascript PDF string. + * Insert Named Destinations. * @protected * @author Johannes Güntert, Nicola Asuni * @since 5.9.098 (2011-06-23)