32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-10-31 18:52:35 +00:00
This commit is contained in:
nicolaasuni 2012-04-10 18:02:43 +01:00
parent f8f51d16cb
commit d8cbe417c8
3 changed files with 61 additions and 11 deletions

View File

@ -1,3 +1,7 @@
5.9.156 (2012-04-10)
- Bug item #3515885 "TOC and booklet: left and right page exchanged".
- SetAutoPageBreak(false) now works also in multicolumn mode.
5.9.155 (2012-04-02) 5.9.155 (2012-04-02)
- Bug item #3512596 "font import problems" was fixed. - Bug item #3512596 "font import problems" was fixed.
- Method addTTFfont() was modified to extract only specified Platform ID and Encoding ID (check the source code documentation). - Method addTTFfont() was modified to extract only specified Platform ID and Encoding ID (check the source code documentation).

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 5.9.155 Version: 5.9.156
Release date: 2012-04-02 Release date: 2012-04-10
Author: Nicola Asuni Author: Nicola Asuni
Copyright (c) 2002-2012: Copyright (c) 2002-2012:

View File

@ -1,9 +1,9 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Version : 5.9.155 // Version : 5.9.156
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2012-04-02 // Last Update : 2012-04-10
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com // Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com
// License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3 // License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -137,7 +137,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.155 * @version 5.9.156
*/ */
// 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.
@ -149,7 +149,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.155 * @version 5.9.156
* @author Nicola Asuni - info@tecnick.com * @author Nicola Asuni - info@tecnick.com
*/ */
class TCPDF { class TCPDF {
@ -160,7 +160,7 @@ class TCPDF {
* Current TCPDF version. * Current TCPDF version.
* @private * @private
*/ */
private $tcpdf_version = '5.9.155'; private $tcpdf_version = '5.9.156';
// Protected properties // Protected properties
@ -5718,7 +5718,7 @@ class TCPDF {
if ($this->current_column < ($this->num_columns - 1)) { if ($this->current_column < ($this->num_columns - 1)) {
// go to next column // go to next column
$this->selectColumn($this->current_column + 1); $this->selectColumn($this->current_column + 1);
} else { } elseif ($this->AutoPageBreak) {
// add a new page // add a new page
$this->AddPage(); $this->AddPage();
// set first column // set first column
@ -26045,11 +26045,13 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$fontstyle = $this->FontStyle; $fontstyle = $this->FontStyle;
$w = $this->w - $this->lMargin - $this->rMargin; $w = $this->w - $this->lMargin - $this->rMargin;
$spacer = $this->GetStringWidth(chr(32)) * 4; $spacer = $this->GetStringWidth(chr(32)) * 4;
$page_first = $this->getPage();
$lmargin = $this->lMargin; $lmargin = $this->lMargin;
$rmargin = $this->rMargin; $rmargin = $this->rMargin;
$x_start = $this->GetX(); $x_start = $this->GetX();
$page_first = $this->page;
$current_page = $this->page; $current_page = $this->page;
$page_fill_start = false;
$page_fill_end = false;
$current_column = $this->current_column; $current_column = $this->current_column;
if ($this->empty_string($numbersfont)) { if ($this->empty_string($numbersfont)) {
$numbersfont = $this->default_monospaced_font; $numbersfont = $this->default_monospaced_font;
@ -26155,8 +26157,26 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$this->Cell($tw, 0, $pagenum, 0, 1, $alignnum, 0, $link, 0); $this->Cell($tw, 0, $pagenum, 0, 1, $alignnum, 0, $link, 0);
} }
$page_last = $this->getPage(); $page_last = $this->getPage();
$numpages = ($page_last - $page_first + 1);
// account for booklet mode
if ($this->booklet) {
// check if a blank page is required before TOC
$page_fill_start = ((($page_first % 2) == 0) XOR (($page % 2) == 0));
$page_fill_end = (!((($numpages % 2) == 0) XOR ($page_fill_start)));
if ($page_fill_start) {
// add a page at the end (to be moved before TOC)
$this->addPage();
++$page_last;
++$numpages;
}
if ($page_fill_end) {
// add a page at the end
$this->addPage();
++$page_last;
++$numpages;
}
}
$maxpage = max($maxpage, $page_last); $maxpage = max($maxpage, $page_last);
$numpages = $page_last - $page_first + 1;
if (!$this->empty_string($page)) { if (!$this->empty_string($page)) {
for ($p = $page_first; $p <= $page_last; ++$p) { for ($p = $page_first; $p <= $page_last; ++$p) {
// get page data // get page data
@ -26199,6 +26219,9 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
} }
// move pages // move pages
$this->Bookmark($toc_name, 0, 0, $page_first, $style, $color); $this->Bookmark($toc_name, 0, 0, $page_first, $style, $color);
if ($page_fill_start) {
$this->movePage($page_last, $page_first);
}
for ($i = 0; $i < $numpages; ++$i) { for ($i = 0; $i < $numpages; ++$i) {
$this->movePage($page_last, $page); $this->movePage($page_last, $page);
} }
@ -26229,6 +26252,8 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$this->htmlLinkColorArray = array(); $this->htmlLinkColorArray = array();
$this->htmlLinkFontStyle = ''; $this->htmlLinkFontStyle = '';
$page_first = $this->getPage(); $page_first = $this->getPage();
$page_fill_start = false;
$page_fill_end = false;
// get the font type used for numbers in each template // get the font type used for numbers in each template
$current_font = $this->FontFamily; $current_font = $this->FontFamily;
foreach ($templates as $level => $html) { foreach ($templates as $level => $html) {
@ -26268,8 +26293,26 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$this->htmlLinkFontStyle = $prev_htmlLinkFontStyle; $this->htmlLinkFontStyle = $prev_htmlLinkFontStyle;
// move TOC page and replace numbers // move TOC page and replace numbers
$page_last = $this->getPage(); $page_last = $this->getPage();
$numpages = ($page_last - $page_first + 1);
// account for booklet mode
if ($this->booklet) {
// check if a blank page is required before TOC
$page_fill_start = ((($page_first % 2) == 0) XOR (($page % 2) == 0));
$page_fill_end = (!((($numpages % 2) == 0) XOR ($page_fill_start)));
if ($page_fill_start) {
// add a page at the end (to be moved before TOC)
$this->addPage();
++$page_last;
++$numpages;
}
if ($page_fill_end) {
// add a page at the end
$this->addPage();
++$page_last;
++$numpages;
}
}
$maxpage = max($maxpage, $page_last); $maxpage = max($maxpage, $page_last);
$numpages = $page_last - $page_first + 1;
if (!$this->empty_string($page)) { if (!$this->empty_string($page)) {
for ($p = $page_first; $p <= $page_last; ++$p) { for ($p = $page_first; $p <= $page_last; ++$p) {
// get page data // get page data
@ -26320,6 +26363,9 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
} }
// move pages // move pages
$this->Bookmark($toc_name, 0, 0, $page_first, $style, $color); $this->Bookmark($toc_name, 0, 0, $page_first, $style, $color);
if ($page_fill_start) {
$this->movePage($page_last, $page_first);
}
for ($i = 0; $i < $numpages; ++$i) { for ($i = 0; $i < $numpages; ++$i) {
$this->movePage($page_last, $page); $this->movePage($page_last, $page);
} }