From 2a40458bd5648bd47d1d6e5be5047130a8a3d554 Mon Sep 17 00:00:00 2001 From: nicolaasuni Date: Wed, 18 May 2011 08:40:32 +0200 Subject: [PATCH] 5.9.081 --- CHANGELOG.TXT | 4 ++++ README.TXT | 4 ++-- tcpdf.php | 38 +++++++++++++++++++++++++++++++++----- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index f53f4a4..ae39848 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,7 @@ +5.9.081 (2011-05-18) + - Method resetHeaderTemplate() was added to reset the xobject template used by Header() method. + - Method setHeaderTemplateAutoreset() was added to automatically reset the xobject template used by Header() method at each page. + 5.9.080 (2011-05-17) - A problem related to file path calculation for images was fixed. - A problem related to unsupressed getimagesize() error was fixed. diff --git a/README.TXT b/README.TXT index f0d7fc5..97d4001 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.080 -Release date: 2011-05-17 +Version: 5.9.081 +Release date: 2011-05-18 Author: Nicola Asuni Copyright (c) 2002-2011: diff --git a/tcpdf.php b/tcpdf.php index 6aabfcc..fdd28e3 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,9 +1,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.080 + * @version 5.9.081 */ // 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.080 + * @version 5.9.081 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -157,7 +157,7 @@ class TCPDF { * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.080'; + private $tcpdf_version = '5.9.081'; // Protected properties @@ -571,6 +571,12 @@ class TCPDF { * @protected */ protected $header_xobjid = -1; + + /** + * If true reset the Header Xobject template at each page + * @protected + */ + protected $header_xobj_autoreset = false; /** * Minimum distance between header and top page margin. @@ -1912,6 +1918,7 @@ class TCPDF { $this->file_id = md5($this->getRandomSeed('TCPDF'.$orientation.$unit.$format.$encoding)); // get default graphic vars $this->default_graphic_vars = $this->getGraphicVars(); + $this->header_xobj_autoreset = false; } /** @@ -4003,6 +4010,23 @@ class TCPDF { return $this->img_rb_y; } + /** + * Reset the xobject template used by Header() method. + * @public + */ + public function resetHeaderTemplate() { + $this->header_xobjid = -1; + } + + /** + * Set a flag to automatically reset the xobject template used by Header() method at each page. + * @param $val (boolean) set to true to reset Header xobject template at each page, false otherwise. + * @public + */ + public function setHeaderTemplateAutoreset($val=true) { + $this->header_xobj_autoreset = $val; + } + /** * This method is used to render the page header. * It is automatically called by AddPage() and could be overwritten in your own inherited class. @@ -4074,6 +4098,10 @@ class TCPDF { $x = 0 + $dx; } $this->printTemplate($this->header_xobjid, $x, 0, 0, 0, '', '', false); + if ($this->header_xobj_autoreset) { + // reset header xobject template at each page + $this->header_xobjid = -1; + } } /**