mirror of
https://github.com/vdm-io/tcpdf.git
synced 2025-04-09 20:21:50 +00:00
5.9.091
This commit is contained in:
parent
d6c918eb88
commit
b5bfb7fd6b
@ -1,3 +1,7 @@
|
|||||||
|
5.9.091 (2011-06-15)
|
||||||
|
- Method _putpages() was improved for faster page numbering.
|
||||||
|
- Bug item #3316678 "Memory overflow when use Rotate and SetAutoPageBreak" was fixed.
|
||||||
|
|
||||||
5.9.090 (2011-06-14)
|
5.9.090 (2011-06-14)
|
||||||
- Methods AliasNbPages() and AliasNumPage() were re-added as deprecated for backward compatibility.
|
- Methods AliasNbPages() and AliasNumPage() were re-added as deprecated for backward compatibility.
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
|
|||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
|
|
||||||
Name: TCPDF
|
Name: TCPDF
|
||||||
Version: 5.9.090
|
Version: 5.9.091
|
||||||
Release date: 2011-06-14
|
Release date: 2011-06-15
|
||||||
Author: Nicola Asuni
|
Author: Nicola Asuni
|
||||||
|
|
||||||
Copyright (c) 2002-2011:
|
Copyright (c) 2002-2011:
|
||||||
|
142
tcpdf.php
142
tcpdf.php
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
//============================================================+
|
//============================================================+
|
||||||
// File name : tcpdf.php
|
// File name : tcpdf.php
|
||||||
// Version : 5.9.090
|
// Version : 5.9.091
|
||||||
// Begin : 2002-08-03
|
// Begin : 2002-08-03
|
||||||
// Last Update : 2011-06-14
|
// Last Update : 2011-06-15
|
||||||
// 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.090
|
* @version 5.9.091
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// 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.090
|
* @version 5.9.091
|
||||||
* @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.090';
|
private $tcpdf_version = '5.9.091';
|
||||||
|
|
||||||
// Protected properties
|
// Protected properties
|
||||||
|
|
||||||
@ -454,7 +454,13 @@ class TCPDF {
|
|||||||
protected $PageBreakTrigger;
|
protected $PageBreakTrigger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag set when processing footer.
|
* Flag set when processing page header.
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
protected $InHeader = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flag set when processing page footer.
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
protected $InFooter = false;
|
protected $InFooter = false;
|
||||||
@ -3833,14 +3839,12 @@ class TCPDF {
|
|||||||
if (($this->page == 0) OR ($this->numpages > $this->page) OR (!$this->pageopen[$this->page])) {
|
if (($this->page == 0) OR ($this->numpages > $this->page) OR (!$this->pageopen[$this->page])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->InFooter = true;
|
|
||||||
// print page footer
|
// print page footer
|
||||||
$this->setFooter();
|
$this->setFooter();
|
||||||
// close page
|
// close page
|
||||||
$this->_endpage();
|
$this->_endpage();
|
||||||
// mark page as closed
|
// mark page as closed
|
||||||
$this->pageopen[$this->page] = false;
|
$this->pageopen[$this->page] = false;
|
||||||
$this->InFooter = false;
|
|
||||||
if ($tocpage) {
|
if ($tocpage) {
|
||||||
$this->tocpage = false;
|
$this->tocpage = false;
|
||||||
}
|
}
|
||||||
@ -4178,7 +4182,10 @@ class TCPDF {
|
|||||||
* @since 4.0.012 (2008-07-24)
|
* @since 4.0.012 (2008-07-24)
|
||||||
*/
|
*/
|
||||||
protected function setHeader() {
|
protected function setHeader() {
|
||||||
if ($this->print_header) {
|
if (!$this->print_header) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$this->InHeader = true;
|
||||||
$this->setGraphicVars($this->default_graphic_vars);
|
$this->setGraphicVars($this->default_graphic_vars);
|
||||||
$temp_thead = $this->thead;
|
$temp_thead = $this->thead;
|
||||||
$temp_theadMargins = $this->theadMargins;
|
$temp_theadMargins = $this->theadMargins;
|
||||||
@ -4206,7 +4213,7 @@ class TCPDF {
|
|||||||
$this->thead = $temp_thead;
|
$this->thead = $temp_thead;
|
||||||
$this->theadMargins = $temp_theadMargins;
|
$this->theadMargins = $temp_theadMargins;
|
||||||
$this->newline = false;
|
$this->newline = false;
|
||||||
}
|
$this->InHeader = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -4216,6 +4223,7 @@ class TCPDF {
|
|||||||
*/
|
*/
|
||||||
protected function setFooter() {
|
protected function setFooter() {
|
||||||
//Page footer
|
//Page footer
|
||||||
|
$this->InFooter = true;
|
||||||
// save current graphic settings
|
// save current graphic settings
|
||||||
$gvars = $this->getGraphicVars();
|
$gvars = $this->getGraphicVars();
|
||||||
// mark this point
|
// mark this point
|
||||||
@ -4258,6 +4266,17 @@ class TCPDF {
|
|||||||
$this->num_columns = $gvars['num_columns'];
|
$this->num_columns = $gvars['num_columns'];
|
||||||
// calculate footer length
|
// calculate footer length
|
||||||
$this->footerlen[$this->page] = $this->pagelen[$this->page] - $this->footerpos[$this->page] + 1;
|
$this->footerlen[$this->page] = $this->pagelen[$this->page] - $this->footerpos[$this->page] + 1;
|
||||||
|
$this->InFooter = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if we are on the page body (excluding page header and footer).
|
||||||
|
* @return true if we are not in page header nor in page footer, false otherwise.
|
||||||
|
* @protected
|
||||||
|
* @since 5.9.091 (2011-06-15)
|
||||||
|
*/
|
||||||
|
protected function inPageBody() {
|
||||||
|
return (($this->InHeader === false) AND ($this->InFooter === false));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -4322,7 +4341,7 @@ class TCPDF {
|
|||||||
* @return int page number
|
* @return int page number
|
||||||
* @public
|
* @public
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
* @see alias_tot_pages(), getAliasNbPages()
|
* @see getAliasNbPages()
|
||||||
*/
|
*/
|
||||||
public function PageNo() {
|
public function PageNo() {
|
||||||
return $this->page;
|
return $this->page;
|
||||||
@ -5398,7 +5417,7 @@ class TCPDF {
|
|||||||
$y = $this->y;
|
$y = $this->y;
|
||||||
}
|
}
|
||||||
$current_page = $this->page;
|
$current_page = $this->page;
|
||||||
if ((($y + $h) > $this->PageBreakTrigger) AND (!$this->InFooter) AND ($this->AcceptPageBreak())) {
|
if ((($y + $h) > $this->PageBreakTrigger) AND ($this->inPageBody()) AND ($this->AcceptPageBreak())) {
|
||||||
if ($addpage) {
|
if ($addpage) {
|
||||||
//Automatic page break
|
//Automatic page break
|
||||||
$x = $this->x;
|
$x = $this->x;
|
||||||
@ -6139,7 +6158,7 @@ class TCPDF {
|
|||||||
$y = $this->GetY();
|
$y = $this->GetY();
|
||||||
}
|
}
|
||||||
$resth = 0;
|
$resth = 0;
|
||||||
if ((!$this->InFooter) AND (($y + $h + $mc_margin['T'] + $mc_margin['B']) > $this->PageBreakTrigger)) {
|
if (($this->inPageBody()) AND (($y + $h + $mc_margin['T'] + $mc_margin['B']) > $this->PageBreakTrigger)) {
|
||||||
// spit cell in more pages/columns
|
// spit cell in more pages/columns
|
||||||
$newh = $this->PageBreakTrigger - $y;
|
$newh = $this->PageBreakTrigger - $y;
|
||||||
$resth = $h - $newh; // cell to be printed on the next page/column
|
$resth = $h - $newh; // cell to be printed on the next page/column
|
||||||
@ -6781,7 +6800,7 @@ class TCPDF {
|
|||||||
$sep = -1;
|
$sep = -1;
|
||||||
$shy = false;
|
$shy = false;
|
||||||
// account for margin changes
|
// account for margin changes
|
||||||
if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND (!$this->InFooter)) {
|
if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND ($this->inPageBody())) {
|
||||||
$this->AcceptPageBreak();
|
$this->AcceptPageBreak();
|
||||||
if ($this->rtl) {
|
if ($this->rtl) {
|
||||||
$this->x -= $margin['R'];
|
$this->x -= $margin['R'];
|
||||||
@ -6968,7 +6987,7 @@ class TCPDF {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// account for margin changes
|
// account for margin changes
|
||||||
if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND (!$this->InFooter)) {
|
if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND ($this->inPageBody())) {
|
||||||
$this->AcceptPageBreak();
|
$this->AcceptPageBreak();
|
||||||
if ($this->rtl) {
|
if ($this->rtl) {
|
||||||
$this->x -= $margin['R'];
|
$this->x -= $margin['R'];
|
||||||
@ -8470,32 +8489,12 @@ class TCPDF {
|
|||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
protected function _putpages() {
|
protected function _putpages() {
|
||||||
|
$filter = ($this->compress) ? '/Filter /FlateDecode ' : '';
|
||||||
$nb = $this->numpages;
|
$nb = $this->numpages;
|
||||||
if (!empty($this->alias_tot_pages)) {
|
|
||||||
$nbs = $this->formatPageNumber($nb);
|
$nbs = $this->formatPageNumber($nb);
|
||||||
$nbu = $this->UTF8ToUTF16BE($nbs, false); // replacement for unicode font
|
$nbu = $this->UTF8ToUTF16BE($nbs, false);
|
||||||
$alias_a = $this->_escape($this->alias_tot_pages);
|
|
||||||
$alias_au = $this->_escape('{'.$this->alias_tot_pages.'}');
|
|
||||||
if ($this->isunicode) {
|
|
||||||
$alias_b = $this->_escape($this->UTF8ToLatin1($this->alias_tot_pages));
|
|
||||||
$alias_bu = $this->_escape($this->UTF8ToLatin1('{'.$this->alias_tot_pages.'}'));
|
|
||||||
$alias_c = $this->_escape($this->utf8StrRev($this->alias_tot_pages, false, $this->tmprtl));
|
|
||||||
$alias_cu = $this->_escape($this->utf8StrRev('{'.$this->alias_tot_pages.'}', false, $this->tmprtl));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!empty($this->alias_num_page)) {
|
|
||||||
$alias_pa = $this->_escape($this->alias_num_page);
|
|
||||||
$alias_pau = $this->_escape('{'.$this->alias_num_page.'}');
|
|
||||||
if ($this->isunicode) {
|
|
||||||
$alias_pb = $this->_escape($this->UTF8ToLatin1($this->alias_num_page));
|
|
||||||
$alias_pbu = $this->_escape($this->UTF8ToLatin1('{'.$this->alias_num_page.'}'));
|
|
||||||
$alias_pc = $this->_escape($this->utf8StrRev($this->alias_num_page, false, $this->tmprtl));
|
|
||||||
$alias_pcu = $this->_escape($this->utf8StrRev('{'.$this->alias_num_page.'}', false, $this->tmprtl));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$pagegroupnum = 0;
|
$pagegroupnum = 0;
|
||||||
$groupnum = 0;
|
$groupnum = 0;
|
||||||
$filter = ($this->compress) ? '/Filter /FlateDecode ' : '';
|
|
||||||
for ($n = 1; $n <= $nb; ++$n) {
|
for ($n = 1; $n <= $nb; ++$n) {
|
||||||
$temppage = $this->getPageBuffer($n);
|
$temppage = $this->getPageBuffer($n);
|
||||||
if (!empty($this->pagegroups)) {
|
if (!empty($this->pagegroups)) {
|
||||||
@ -8504,73 +8503,26 @@ class TCPDF {
|
|||||||
++$groupnum;
|
++$groupnum;
|
||||||
}
|
}
|
||||||
++$pagegroupnum;
|
++$pagegroupnum;
|
||||||
$ka = $this->alias_group_tot_pages;
|
// replace total page group numbers
|
||||||
$kb = '{'.$ka.'}';
|
|
||||||
$kpa = $this->alias_group_num_page;
|
|
||||||
$kpb = '{'.$kpa.'}';
|
|
||||||
// replace total pages group numbers
|
|
||||||
$vs = $this->formatPageNumber($this->pagegroups[$groupnum]);
|
$vs = $this->formatPageNumber($this->pagegroups[$groupnum]);
|
||||||
$vu = $this->UTF8ToUTF16BE($vs, false);
|
$vu = $this->UTF8ToUTF16BE($vs, false);
|
||||||
$alias_ga = $this->_escape($ka);
|
$temppage = str_replace('{'.$this->alias_group_tot_pages.'}', $vu, $temppage);
|
||||||
$alias_gau = $this->_escape($kb);
|
$temppage = str_replace($this->alias_group_tot_pages, $vs, $temppage);
|
||||||
if ($this->isunicode) {
|
|
||||||
$alias_gb = $this->_escape($this->UTF8ToLatin1($ka));
|
|
||||||
$alias_gbu = $this->_escape($this->UTF8ToLatin1($kb));
|
|
||||||
$alias_gc = $this->_escape($this->utf8StrRev($ka, false, $this->tmprtl));
|
|
||||||
$alias_gcu = $this->_escape($this->utf8StrRev($kb, false, $this->tmprtl));
|
|
||||||
}
|
|
||||||
$temppage = str_replace($alias_gau, $vu, $temppage);
|
|
||||||
if ($this->isunicode) {
|
|
||||||
$temppage = str_replace($alias_gbu, $vu, $temppage);
|
|
||||||
$temppage = str_replace($alias_gcu, $vu, $temppage);
|
|
||||||
$temppage = str_replace($alias_gb, $vs, $temppage);
|
|
||||||
$temppage = str_replace($alias_gc, $vs, $temppage);
|
|
||||||
}
|
|
||||||
$temppage = str_replace($alias_ga, $vs, $temppage);
|
|
||||||
// replace page group numbers
|
// replace page group numbers
|
||||||
$pvs = $this->formatPageNumber($pagegroupnum);
|
$pvs = $this->formatPageNumber($pagegroupnum);
|
||||||
$pvu = $this->UTF8ToUTF16BE($pvs, false);
|
$pvu = $this->UTF8ToUTF16BE($pvs, false);
|
||||||
$alias_pga = $this->_escape($kpa);
|
$temppage = str_replace('{'.$this->alias_group_num_page.'}', $pvu, $temppage);
|
||||||
$alias_pgau = $this->_escape($kpb);
|
$temppage = str_replace($this->alias_group_num_page, $pvs, $temppage);
|
||||||
if ($this->isunicode) {
|
|
||||||
$alias_pgb = $this->_escape($this->UTF8ToLatin1($kpa));
|
|
||||||
$alias_pgbu = $this->_escape($this->UTF8ToLatin1($kpb));
|
|
||||||
$alias_pgc = $this->_escape($this->utf8StrRev($kpa, false, $this->tmprtl));
|
|
||||||
$alias_pgcu = $this->_escape($this->utf8StrRev($kpb, false, $this->tmprtl));
|
|
||||||
}
|
}
|
||||||
$temppage = str_replace($alias_pgau, $pvu, $temppage);
|
|
||||||
if ($this->isunicode) {
|
|
||||||
$temppage = str_replace($alias_pgbu, $pvu, $temppage);
|
|
||||||
$temppage = str_replace($alias_pgcu, $pvu, $temppage);
|
|
||||||
$temppage = str_replace($alias_pgb, $pvs, $temppage);
|
|
||||||
$temppage = str_replace($alias_pgc, $pvs, $temppage);
|
|
||||||
}
|
|
||||||
$temppage = str_replace($alias_pga, $pvs, $temppage);
|
|
||||||
}
|
|
||||||
if (!empty($this->alias_tot_pages)) {
|
|
||||||
// replace total pages number
|
// replace total pages number
|
||||||
$temppage = str_replace($alias_au, $nbu, $temppage);
|
$temppage = str_replace('{'.$this->alias_tot_pages.'}', $nbu, $temppage);
|
||||||
if ($this->isunicode) {
|
$temppage = str_replace($this->alias_tot_pages, $nbs, $temppage);
|
||||||
$temppage = str_replace($alias_bu, $nbu, $temppage);
|
|
||||||
$temppage = str_replace($alias_cu, $nbu, $temppage);
|
|
||||||
$temppage = str_replace($alias_b, $nbs, $temppage);
|
|
||||||
$temppage = str_replace($alias_c, $nbs, $temppage);
|
|
||||||
}
|
|
||||||
$temppage = str_replace($alias_a, $nbs, $temppage);
|
|
||||||
}
|
|
||||||
if (!empty($this->alias_num_page)) {
|
|
||||||
// replace page number
|
// replace page number
|
||||||
$pnbs = $this->formatPageNumber($n);
|
$pnbs = $this->formatPageNumber($n);
|
||||||
$pnbu = $this->UTF8ToUTF16BE($pnbs, false); // replacement for unicode font
|
$pnbu = $this->UTF8ToUTF16BE($pnbs, false); // replacement for unicode font
|
||||||
$temppage = str_replace($alias_pau, $pnbu, $temppage);
|
$temppage = str_replace('{'.$this->alias_num_page.'}', $pnbu, $temppage);
|
||||||
if ($this->isunicode) {
|
$temppage = str_replace($this->alias_num_page, $pnbs, $temppage);
|
||||||
$temppage = str_replace($alias_pbu, $pnbu, $temppage);
|
// replace EPS marker
|
||||||
$temppage = str_replace($alias_pcu, $pnbu, $temppage);
|
|
||||||
$temppage = str_replace($alias_pb, $pnbs, $temppage);
|
|
||||||
$temppage = str_replace($alias_pc, $pnbs, $temppage);
|
|
||||||
}
|
|
||||||
$temppage = str_replace($alias_pa, $pnbs, $temppage);
|
|
||||||
}
|
|
||||||
$temppage = str_replace($this->epsmarker, '', $temppage);
|
$temppage = str_replace($this->epsmarker, '', $temppage);
|
||||||
//Page
|
//Page
|
||||||
$this->page_obj_id[$n] = $this->_newobj();
|
$this->page_obj_id[$n] = $this->_newobj();
|
||||||
@ -19716,7 +19668,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$autolinebreak) {
|
if (!$autolinebreak) {
|
||||||
if (!$this->InFooter) {
|
if ($this->inPageBody()) {
|
||||||
$pre_y = $this->y;
|
$pre_y = $this->y;
|
||||||
// check for page break
|
// check for page break
|
||||||
if ((!$this->checkPageBreak($imgh)) AND ($this->y < $pre_y)) {
|
if ((!$this->checkPageBreak($imgh)) AND ($this->y < $pre_y)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user