32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-12-23 17:08:53 +00:00
This commit is contained in:
nicolaasuni 2011-03-08 15:37:36 +01:00
parent 9050b2421e
commit 476d1bcb10
3 changed files with 22 additions and 18 deletions

View File

@ -1,3 +1,6 @@
5.9.060 (2011-03-08)
- addTOC() method was fixed for text alignment problems.
5.9.059 (2011-02-27) 5.9.059 (2011-02-27)
- Default Header() method was improved to reduce document size. - Default Header() method was improved to reduce document size.
@ -18,7 +21,7 @@
- A bug related to HTML table page break was fixed. - A bug related to HTML table page break was fixed.
5.9.053 (2011-02-16) 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) 5.9.052 (2011-02-15)
- A bug related to HTML automatic newlines was fixed. - A bug related to HTML automatic newlines was fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 5.9.059 Version: 5.9.060
Release date: 2011-02-27 Release date: 2011-03-08
Author: Nicola Asuni Author: Nicola Asuni
Copyright (c) 2002-2011: Copyright (c) 2002-2011:

View File

@ -1,9 +1,9 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Version : 5.9.059 // Version : 5.9.060
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2011-02-27 // Last Update : 2011-03-08
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com // Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
// License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3 + YOU CAN'T REMOVE ANY TCPDF COPYRIGHT NOTICE OR LINK FROM THE GENERATED PDF DOCUMENTS. // License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3 + YOU CAN'T REMOVE ANY TCPDF COPYRIGHT NOTICE OR LINK FROM THE GENERATED PDF DOCUMENTS.
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -134,7 +134,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p> * Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @author Nicola Asuni * @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. // 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.<br> * 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.<br>
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @brief PHP class for generating PDF documents without requiring external extensions. * @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 * @author Nicola Asuni - info@tecnick.com
*/ */
class TCPDF { class TCPDF {
@ -157,7 +157,7 @@ class TCPDF {
* Current TCPDF version. * Current TCPDF version.
* @private * @private
*/ */
private $tcpdf_version = '5.9.059'; private $tcpdf_version = '5.9.060';
// Protected properties // Protected properties
@ -23324,6 +23324,8 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$page = 1; $page = 1;
} }
} }
$this->SetFont($numbersfont, $fontstyle, $fontsize);
$numwidth = $this->GetStringWidth('00000');
foreach ($this->outlines as $key => $outline) { foreach ($this->outlines as $key => $outline) {
if ($this->rtl) { if ($this->rtl) {
$aligntext = 'R'; $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']); $this->SetFont($fontfamily, $fontstyle, $fontsize - $outline['l']);
} }
// check for page break // 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 // set margins and X position
if (($this->page == $current_page) AND ($this->current_column == $current_column)) { if (($this->page == $current_page) AND ($this->current_column == $current_column)) {
$this->lMargin = $lmargin; $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); $this->SetX($x_start);
$indent = ($spacer * $outline['l']); $indent = ($spacer * $outline['l']);
if ($this->rtl) { if ($this->rtl) {
$this->rMargin += $indent;
$this->x -= $indent; $this->x -= $indent;
$this->rMargin = $this->w - $this->x;
} else { } else {
$this->lMargin += $indent;
$this->x += $indent; $this->x += $indent;
$this->lMargin = $this->x;
} }
$link = $this->AddLink(); $link = $this->AddLink();
$this->SetLink($link, $outline['y'], $outline['p']); $this->SetLink($link, $outline['y'], $outline['p']);
// write the text // 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); $this->SetFont($numbersfont, $fontstyle, $fontsize);
if ($this->empty_string($page)) { if ($this->empty_string($page)) {
$pagenum = $outline['p']; $pagenum = $outline['p'];
@ -23379,12 +23386,6 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$pagenum = '{'.$pagenum.'}'; $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)); $fw = $tw - $numwidth - $this->GetStringWidth(chr(32));
$numfills = floor($fw / $this->GetStringWidth($filler)); $numfills = floor($fw / $this->GetStringWidth($filler));
if ($numfills > 0) { if ($numfills > 0) {