diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index ebfd313..1b96279 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,6 @@ +5.9.060 (2011-03-08) + - addTOC() method was fixed for text alignment problems. + 5.9.059 (2011-02-27) - Default Header() method was improved to reduce document size. @@ -18,7 +21,7 @@ - A bug related to HTML table page break was fixed. 5.9.053 (2011-02-16) - - Support for HTMl attribute display="none" was added. + - Support for HTML attribute display="none" was added. 5.9.052 (2011-02-15) - A bug related to HTML automatic newlines was fixed. diff --git a/README.TXT b/README.TXT index 7a07e67..7b5ef2f 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.059 -Release date: 2011-02-27 +Version: 5.9.060 +Release date: 2011-03-08 Author: Nicola Asuni Copyright (c) 2002-2011: diff --git a/tcpdf.php b/tcpdf.php index dcd9835..85acc68 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,9 +1,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.059 + * @version 5.9.060 */ // 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.059 + * @version 5.9.060 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -157,7 +157,7 @@ class TCPDF { * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.059'; + private $tcpdf_version = '5.9.060'; // Protected properties @@ -23324,6 +23324,8 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $page = 1; } } + $this->SetFont($numbersfont, $fontstyle, $fontsize); + $numwidth = $this->GetStringWidth('00000'); foreach ($this->outlines as $key => $outline) { if ($this->rtl) { $aligntext = 'R'; @@ -23338,7 +23340,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $this->SetFont($fontfamily, $fontstyle, $fontsize - $outline['l']); } // check for page break - $this->checkPageBreak(($this->FontSize * $this->cell_height_ratio)); + $this->checkPageBreak(2*($this->FontSize * $this->cell_height_ratio)); // set margins and X position if (($this->page == $current_page) AND ($this->current_column == $current_column)) { $this->lMargin = $lmargin; @@ -23359,16 +23361,21 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $this->SetX($x_start); $indent = ($spacer * $outline['l']); if ($this->rtl) { - $this->rMargin += $indent; $this->x -= $indent; + $this->rMargin = $this->w - $this->x; } else { - $this->lMargin += $indent; $this->x += $indent; + $this->lMargin = $this->x; } $link = $this->AddLink(); $this->SetLink($link, $outline['y'], $outline['p']); // write the text - $this->Write(0, $outline['t'], $link, 0, $aligntext, false, 0, false, false, 0); + $this->Write(0, $outline['t'], $link, false, $aligntext, false, 0, false, false, 0, $numwidth, ''); + if ($this->rtl) { + $tw = $this->x - $this->lMargin; + } else { + $tw = $this->w - $this->rMargin - $this->x; + } $this->SetFont($numbersfont, $fontstyle, $fontsize); if ($this->empty_string($page)) { $pagenum = $outline['p']; @@ -23379,12 +23386,6 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $pagenum = '{'.$pagenum.'}'; } } - $numwidth = $this->GetStringWidth($pagenum); - if ($this->rtl) { - $tw = $this->x - $this->lMargin; - } else { - $tw = $this->w - $this->rMargin - $this->x; - } $fw = $tw - $numwidth - $this->GetStringWidth(chr(32)); $numfills = floor($fw / $this->GetStringWidth($filler)); if ($numfills > 0) {