From f6007922060da0c7e29b646eb6aee465f92f4d53 Mon Sep 17 00:00:00 2001 From: nicolaasuni Date: Tue, 5 May 2009 10:25:50 +0200 Subject: [PATCH] 4.6.007 --- CHANGELOG.TXT | 5 ++ README.TXT | 6 +- doc/classtrees_com-tecnick-tcpdf.html | 2 +- doc/com-tecnick-tcpdf/TCPDF.html | 80 +++++++++---------- doc/com-tecnick-tcpdf/TCPDFBarcode.html | 2 +- doc/com-tecnick-tcpdf/_barcodes.php.html | 2 +- .../_config---tcpdf_config.php.html | 2 +- doc/com-tecnick-tcpdf/_htmlcolors.php.html | 2 +- doc/com-tecnick-tcpdf/_tcpdf.php.html | 6 +- doc/com-tecnick-tcpdf/_unicode_data.php.html | 2 +- doc/elementindex.html | 2 +- doc/elementindex_com-tecnick-tcpdf.html | 2 +- doc/errors.html | 2 +- doc/index.html | 2 +- doc/li_com-tecnick-tcpdf.html | 2 +- tcpdf.php | 61 +++++++------- 16 files changed, 90 insertions(+), 90 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 6ae5305..3da4cb1 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,8 @@ +4.6.007 (2009-05-05) + - Bug #2786685 "writeHtmlCell and
in custom footer" was fixed. + - Table header repeating bug was fixed. + - Some newlines and tabs are now automatically removed from HTML strings. + 4.6.006 (2009-04-28) - Support for "..." was added. - By default TCPDF requires PCRE Unicode support turned on but now works also without it (with limited ability to detect some Unicode blank spaces). diff --git a/README.TXT b/README.TXT index 63487fb..8d0f019 100755 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 4.6.006 -Release date: 2009-04-28 +Version: 4.6.007 +Release date: 2009-05-05 Author: Nicola Asuni Copyright (c) 2001-2009: @@ -56,7 +56,7 @@ Main Features: Installation (full instructions on http://www.tcpdf.org): 1. copy the folder on your Web server - 2. set your installation path on the config/tcpdf_config.php + 2. set your installation path and other parameters on the config/tcpdf_config.php 3. call the example/example_001.php page with your browser to see an example Source Code Documentation: diff --git a/doc/classtrees_com-tecnick-tcpdf.html b/doc/classtrees_com-tecnick-tcpdf.html index 6ddb76e..77ea883 100644 --- a/doc/classtrees_com-tecnick-tcpdf.html +++ b/doc/classtrees_com-tecnick-tcpdf.html @@ -45,7 +45,7 @@

- Documentation generated on Tue, 28 Apr 2009 10:11:58 +0200 by phpDocumentor 1.4.1 + Documentation generated on Tue, 05 May 2009 10:25:37 +0200 by phpDocumentor 1.4.1
diff --git a/doc/com-tecnick-tcpdf/TCPDF.html b/doc/com-tecnick-tcpdf/TCPDF.html index 43d3291..ffad5a7 100644 --- a/doc/com-tecnick-tcpdf/TCPDF.html +++ b/doc/com-tecnick-tcpdf/TCPDF.html @@ -74,7 +74,7 @@ Source Location: /tcpdf.php

Version:

@@ -587,7 +587,7 @@ This is a PHP class for generating PDF documents without requiring external exte author:  Nicola Asuni - info@tecnick.com - version:  4.6.006 + version:  4.6.007 link:  http://www.tcpdf.org @@ -5511,7 +5511,7 @@ $style = -1])
-

method addHTMLVertSpace [line 12621]

+

method addHTMLVertSpace [line 12616]

@@ -5722,7 +5722,7 @@ $k)
-

method addTOC [line 13643]

+

method addTOC [line 13638]

@@ -6512,7 +6512,7 @@ $h)
-

method closeHTMLTagHandler [line 12297]

+

method closeHTMLTagHandler [line 12292]

@@ -6626,7 +6626,7 @@ $prop = array()])
-

method commitTransaction [line 13800]

+

method commitTransaction [line 13795]

@@ -6897,7 +6897,7 @@ $fill_color = array()])
-

method deletePage [line 13503]

+

method deletePage [line 13498]

@@ -7056,7 +7056,7 @@ $afinish:)
-

method empty_string [line 13847]

+

method empty_string [line 13842]

@@ -7560,7 +7560,7 @@ $pagenum = ''])
-

method getBuffer [line 13189]

+

method getBuffer [line 13184]

@@ -7757,7 +7757,7 @@ $char)
-

method getFontBuffer [line 13349]

+

method getFontBuffer [line 13344]

@@ -8046,7 +8046,7 @@ $v)
-

method getGraphicVars [line 13057]

+

method getGraphicVars [line 13052]

@@ -8256,7 +8256,7 @@ $html)
-

method getHTMLUnitToUnits [line 12776]

+

method getHTMLUnitToUnits [line 12771]

@@ -8322,7 +8322,7 @@ $point)
-

method getImageBuffer [line 13291]

+

method getImageBuffer [line 13286]

@@ -8668,7 +8668,7 @@ $w = 0])
-

method getObjFilename [line 13121]

+

method getObjFilename [line 13116]

@@ -8778,7 +8778,7 @@ $prefix)
-

method getPageBuffer [line 13232]

+

method getPageBuffer [line 13227]

@@ -9693,7 +9693,7 @@ $script)
-

method intToRoman [line 12850]

+

method intToRoman [line 12845]

@@ -10287,7 +10287,7 @@ $y = ''])
-

method movePage [line 13366]

+

method movePage [line 13361]

@@ -10461,7 +10461,7 @@ $maxh = 0])
-

method objclone [line 13836]

+

method objclone [line 13831]

@@ -10534,7 +10534,7 @@ $object)
-

method openHTMLTagHandler [line 11973]

+

method openHTMLTagHandler [line 11968]

@@ -10974,7 +10974,7 @@ $fill_color = array()])
-

method putHtmlListBullet [line 12915]

+

method putHtmlListBullet [line 12910]

@@ -11151,7 +11151,7 @@ $prop = array()])
-

method readDiskCache [line 13161]

+

method readDiskCache [line 13156]

@@ -11481,7 +11481,7 @@ $length)
-

method rollbackTransaction [line 13813]

+

method rollbackTransaction [line 13808]

@@ -12043,7 +12043,7 @@ $bc = ''])
-

method SetBooklet [line 12690]

+

method SetBooklet [line 12685]

@@ -12094,7 +12094,7 @@ $outer = -1])
-

method setBuffer [line 13171]

+

method setBuffer [line 13166]

@@ -12814,7 +12814,7 @@ $fontfile = ''])
-

method setFontBuffer [line 13307]

+

method setFontBuffer [line 13302]

@@ -12901,7 +12901,7 @@ $size)
-

method setFontSubBuffer [line 13329]

+

method setFontSubBuffer [line 13324]

@@ -13055,7 +13055,7 @@ $fm = 10])
-

method setGraphicVars [line 13088]

+

method setGraphicVars [line 13083]

@@ -13251,7 +13251,7 @@ $hm = 10])
-

method setHtmlLinksStyle [line 12761]

+

method setHtmlLinksStyle [line 12756]

@@ -13296,7 +13296,7 @@ $fontstyle = 'U'])
-

method setHtmlVSpace [line 12730]

+

method setHtmlVSpace [line 12725]

@@ -13335,7 +13335,7 @@ $tagvs)
-

method setImageBuffer [line 13248]

+

method setImageBuffer [line 13243]

@@ -13422,7 +13422,7 @@ $scale)
-

method setImageSubBuffer [line 13271]

+

method setImageSubBuffer [line 13266]

@@ -13816,7 +13816,7 @@ $page = -1])
-

method setListIndentWidth [line 12740]

+

method setListIndentWidth [line 12735]

@@ -13855,7 +13855,7 @@ $width)
-

method setLIsymbol [line 12650]

+

method setLIsymbol [line 12645]

diff --git a/tcpdf.php b/tcpdf.php index ee1be1c..706cf30 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -2,9 +2,9 @@ //============================================================+ // File name : tcpdf.php // Begin : 2002-08-03 -// Last Update : 2009-04-28 +// Last Update : 2009-05-05 // Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org -// Version : 4.6.006 +// Version : 4.6.007 // License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html) // ---------------------------------------------------------------------------- // Copyright (C) 2002-2009 Nicola Asuni - Tecnick.com S.r.l. @@ -126,7 +126,7 @@ * @copyright 2002-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com * @link http://www.tcpdf.org * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version 4.6.006 + * @version 4.6.007 */ /** @@ -150,14 +150,14 @@ if (!class_exists('TCPDF', false)) { /** * define default PDF document producer */ - define('PDF_PRODUCER', 'TCPDF 4.6.006 (http://www.tcpdf.org)'); + define('PDF_PRODUCER', 'TCPDF 4.6.007 (http://www.tcpdf.org)'); /** * This is a PHP class for generating PDF documents without requiring external extensions.
* 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.
* @name TCPDF * @package com.tecnick.tcpdf - * @version 4.6.006 + * @version 4.6.007 * @author Nicola Asuni - info@tecnick.com * @link http://www.tcpdf.org * @license http://www.gnu.org/copyleft/lesser.html LGPL @@ -10757,29 +10757,26 @@ if (!class_exists('TCPDF', false)) { protected function getHtmlDomArray($html) { // remove all unsupported tags (the line below lists all supported tags) $html = strip_tags($html, '



  • diff --git a/doc/li_com-tecnick-tcpdf.html b/doc/li_com-tecnick-tcpdf.html index 70c12e2..1ba32f3 100644 --- a/doc/li_com-tecnick-tcpdf.html +++ b/doc/li_com-tecnick-tcpdf.html @@ -58,7 +58,7 @@ This documentation was generated by phpDocumentor v1.4.1

    - Documentation generated on Tue, 28 Apr 2009 10:11:58 +0200 by phpDocumentor 1.4.1 + Documentation generated on Tue, 05 May 2009 10:25:37 +0200 by phpDocumentor 1.4.1
    @@ -13948,7 +13948,7 @@ $right = -1])
    -

    method setOpenCell [line 12750]

    +

    method setOpenCell [line 12745]

    diff --git a/doc/index.html b/doc/index.html index 70c12e2..1ba32f3 100644 --- a/doc/index.html +++ b/doc/index.html @@ -58,7 +58,7 @@ This documentation was generated by phpDocumentor v1.4.1

    - Documentation generated on Tue, 28 Apr 2009 10:11:58 +0200 by phpDocumentor 1.4.1 + Documentation generated on Tue, 05 May 2009 10:25:37 +0200 by phpDocumentor 1.4.1
    diff --git a/doc/errors.html b/doc/errors.html index 8f411ac..cfd293e 100644 --- a/doc/errors.html +++ b/doc/errors.html @@ -35,7 +35,7 @@ Post-parsing

    - Documentation generated on Tue, 28 Apr 2009 10:12:04 +0200 by phpDocumentor 1.4.1 + Documentation generated on Tue, 05 May 2009 10:25:43 +0200 by phpDocumentor 1.4.1
    @@ -14035,7 +14035,7 @@ $resetmargins = false])
    -

    method setPageBuffer [line 13205]

    +

    method setPageBuffer [line 13200]

    diff --git a/doc/elementindex_com-tecnick-tcpdf.html b/doc/elementindex_com-tecnick-tcpdf.html index 7eb7421..f55b7b0 100644 --- a/doc/elementindex_com-tecnick-tcpdf.html +++ b/doc/elementindex_com-tecnick-tcpdf.html @@ -1385,7 +1385,7 @@ top

    - Documentation generated on Tue, 28 Apr 2009 10:11:57 +0200 by phpDocumentor 1.4.1 + Documentation generated on Tue, 05 May 2009 10:25:37 +0200 by phpDocumentor 1.4.1
    diff --git a/doc/elementindex.html b/doc/elementindex.html index 9535b86..6bd2f51 100644 --- a/doc/elementindex.html +++ b/doc/elementindex.html @@ -1362,7 +1362,7 @@ top

    - Documentation generated on Tue, 28 Apr 2009 10:11:57 +0200 by phpDocumentor 1.4.1 + Documentation generated on Tue, 05 May 2009 10:25:37 +0200 by phpDocumentor 1.4.1
    @@ -15541,7 +15541,7 @@ $page = ''])
    -

    method startTransaction [line 13786]

    +

    method startTransaction [line 13781]

    diff --git a/doc/com-tecnick-tcpdf/_unicode_data.php.html b/doc/com-tecnick-tcpdf/_unicode_data.php.html index e187b49..41b905d 100644 --- a/doc/com-tecnick-tcpdf/_unicode_data.php.html +++ b/doc/com-tecnick-tcpdf/_unicode_data.php.html @@ -237,7 +237,7 @@ Unicode Include file for TCPDF.




    - Documentation generated on Tue, 28 Apr 2009 10:12:03 +0200 by phpDocumentor 1.4.1 + Documentation generated on Tue, 05 May 2009 10:25:43 +0200 by phpDocumentor 1.4.1
    @@ -15631,7 +15631,7 @@ $page = ''])
    -

    method swapMargins [line 12706]

    +

    method swapMargins [line 12701]

    diff --git a/doc/com-tecnick-tcpdf/_tcpdf.php.html b/doc/com-tecnick-tcpdf/_tcpdf.php.html index cbbd32a..742afeb 100644 --- a/doc/com-tecnick-tcpdf/_tcpdf.php.html +++ b/doc/com-tecnick-tcpdf/_tcpdf.php.html @@ -73,7 +73,7 @@ This is a PHP class for generating PDF documents without requiring external exte - + @@ -104,7 +104,7 @@ unicode data

    diff --git a/doc/com-tecnick-tcpdf/_htmlcolors.php.html b/doc/com-tecnick-tcpdf/_htmlcolors.php.html index 03722be..e074bf3 100644 --- a/doc/com-tecnick-tcpdf/_htmlcolors.php.html +++ b/doc/com-tecnick-tcpdf/_htmlcolors.php.html @@ -88,7 +88,7 @@ Array of WEB safe colors.




    - Documentation generated on Tue, 28 Apr 2009 10:11:58 +0200 by phpDocumentor 1.4.1 + Documentation generated on Tue, 05 May 2009 10:25:38 +0200 by phpDocumentor 1.4.1
    @@ -16825,7 +16825,7 @@ $code)
    -

    method writeDiskCache [line 13133]

    +

    method writeDiskCache [line 13128]

    diff --git a/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html b/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html index da2f8d4..211fdcb 100644 --- a/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html +++ b/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html @@ -507,7 +507,7 @@ Configuration file for TCPDF.




    - Documentation generated on Tue, 28 Apr 2009 10:12:03 +0200 by phpDocumentor 1.4.1 + Documentation generated on Tue, 05 May 2009 10:25:43 +0200 by phpDocumentor 1.4.1
    diff --git a/doc/com-tecnick-tcpdf/_barcodes.php.html b/doc/com-tecnick-tcpdf/_barcodes.php.html index e615f8d..5d87e34 100644 --- a/doc/com-tecnick-tcpdf/_barcodes.php.html +++ b/doc/com-tecnick-tcpdf/_barcodes.php.html @@ -96,7 +96,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit

    - Documentation generated on Tue, 28 Apr 2009 10:11:58 +0200 by phpDocumentor 1.4.1 + Documentation generated on Tue, 05 May 2009 10:25:37 +0200 by phpDocumentor 1.4.1
    @@ -16882,7 +16882,7 @@ $file)
    -

    method writeHTML [line 11153]

    +

    method writeHTML [line 11150]

    diff --git a/doc/com-tecnick-tcpdf/TCPDFBarcode.html b/doc/com-tecnick-tcpdf/TCPDFBarcode.html index 3e9d32e..2f0359d 100644 --- a/doc/com-tecnick-tcpdf/TCPDFBarcode.html +++ b/doc/com-tecnick-tcpdf/TCPDFBarcode.html @@ -1368,7 +1368,7 @@ $type)

    - Documentation generated on Tue, 28 Apr 2009 10:11:58 +0200 by phpDocumentor 1.4.1 + Documentation generated on Tue, 05 May 2009 10:25:37 +0200 by phpDocumentor 1.4.1
    @@ -19113,7 +19113,7 @@ $file)

    - Documentation generated on Tue, 28 Apr 2009 10:11:58 +0200 by phpDocumentor 1.4.1 + Documentation generated on Tue, 05 May 2009 10:25:38 +0200 by phpDocumentor 1.4.1
    author:  Nicola Asuni
    version:  4.6.006version:  4.6.007
    copyright:  2002-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
    - PDF_PRODUCER = 'TCPDF 4.6.006 (http://www.tcpdf.org)' + PDF_PRODUCER = 'TCPDF 4.6.007 (http://www.tcpdf.org)'
    @@ -115,7 +115,7 @@ unicode data


    - Documentation generated on Tue, 28 Apr 2009 10:11:58 +0200 by phpDocumentor 1.4.1 + Documentation generated on Tue, 05 May 2009 10:25:38 +0200 by phpDocumentor 1.4.1
      '); - //replace some blank characters + //replace some blank characters + $html = preg_replace('/
      ]*)>[\n\r\t]+/', '<\\1\\2>', $html);
       			$html = preg_replace('@(\r\n|\r)@', "\n", $html);
       			$repTable = array("\t" => ' ', "\0" => ' ', "\x0B" => ' ', "\\" => "\\\\");
       			$html = strtr($html, $repTable);
      -			while (preg_match("']*)>(.*?)\n(.*?)
      'si", $html)) { + while (preg_match("']*)>(.*?)\n(.*?)'si", $html)) { // preserve newlines on
       tag
      -				$html = preg_replace("']*)>(.*?)\n(.*?)
      'si", "\\2
      \\3", $html); + $html = preg_replace("']*)>(.*?)\n(.*?)'si", "\\2
      \\3", $html); } - $html = str_replace("\n", ' ', $html); - /* - $html = preg_replace("']*)>'si", "
    ", $html); - $html = preg_replace("''si", "
    ", $html); - $html = preg_replace("']*)>'si", "", $html); - $html = preg_replace("''si", "
    ", $html); - */ + $html = str_replace("\n", ' ', $html); // remove extra spaces from code $html = preg_replace('/[\s]+<\/(table|tr|td|th|ul|ol|li)>/', '', $html); $html = preg_replace('/[\s]+<(tr|td|th|ul|ol|li|br)/', '<\\1', $html); - $html = preg_replace('/<\/(table|tr|td|th|blockquote|dd|div|dt|h1|h2|h3|h4|h5|h6|hr|li|ol|p|ul)>[\s]+<', $html); + $html = preg_replace('/<\/(table|tr|td|th|blockquote|dd|div|dt|h1|h2|h3|h4|h5|h6|hr|li|ol|ul|p)>[\s]+<', $html); $html = preg_replace('/<\/(td|th)>/', '', $html); $html = preg_replace('/<\/table>([\s]*)/', '
    ', $html); $html = preg_replace('/]*)>/xi', '', $html); + $html = preg_replace('/newline AND (strlen($dom[$key]['value']) > 0) AND ($dom[$key]['value'] != 'td') AND ($dom[$key]['value'] != 'th')) { $newline = true; - // we are at the beginning of a new line + // we are at the beginning of a new line if (isset($startlinex)) { $yshift = $minstartliney - $startliney; if (($yshift > 0) OR ($this->page > $startlinepage)) { @@ -11343,12 +11340,12 @@ if (!class_exists('TCPDF', false)) { // the last line must be shifted to be aligned as requested $linew = abs($this->endlinex - $startlinex); $pstart = substr($this->getPageBuffer($startlinepage), 0, $startlinepos); - if (isset($opentagpos) AND isset($this->footerlen[$startlinepage])) { + if (isset($opentagpos) AND isset($this->footerlen[$startlinepage]) AND (!$this->InFooter)) { $this->footerpos[$startlinepage] = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; $midpos = min($opentagpos, $this->footerpos[$startlinepage]); } elseif (isset($opentagpos)) { $midpos = $opentagpos; - } elseif (isset($this->footerlen[$startlinepage])) { + } elseif (isset($this->footerlen[$startlinepage]) AND (!$this->InFooter)) { $this->footerpos[$startlinepage] = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; $midpos = $this->footerpos[$startlinepage]; } else { @@ -11390,7 +11387,6 @@ if (!class_exists('TCPDF', false)) { } $no = 0; $ns = 0; - $pmidtemp = $pmid; // escape special characters $pmidtemp = preg_replace('/[\\\][\(]/x', '\\#!#OP#!#', $pmidtemp); @@ -11398,7 +11394,6 @@ if (!class_exists('TCPDF', false)) { // search spaces if (preg_match_all('/\[\(([^\)]*)\)\]/x', $pmidtemp, $lnstring, PREG_PATTERN_ORDER)) { $maxkk = count($lnstring[1]) - 1; - //foreach ($lnstring[1] as $kk => $value) { for ($kk=0; $kk <= $maxkk; ++$kk) { // restore special characters $lnstring[1][$kk] = str_replace('#!#OP#!#', '(', $lnstring[1][$kk]); @@ -11548,7 +11543,7 @@ if (!class_exists('TCPDF', false)) { if (($t_x != 0) OR ($yshift < 0)) { // shift the line $trx = sprintf('1 0 0 1 %.3F %.3F cm', ($t_x * $this->k), ($yshift * $this->k)); - $this->setPageBuffer($startlinepage, $pstart."\nq\n".$trx."\n".$pmid."\nQ\n".$pend); + $this->setPageBuffer($startlinepage, $pstart."\nq\n".$trx."\n".$pmid."\nQ\n".$pend); $endlinepos = strlen($pstart."\nq\n".$trx."\n".$pmid."\nQ\n"); // shift the annotations and links if (isset($this->PageAnnots[$this->page])) { @@ -11791,8 +11786,8 @@ if (!class_exists('TCPDF', false)) { } else { $this->footerpos[$this->page] = $this->pagelen[$this->page]; } - } - $opentagpos = $this->footerpos[$this->page]; + $opentagpos = $this->footerpos[$this->page]; + } } $this->openHTMLTagHandler($dom, $key, $cell); } @@ -11891,12 +11886,12 @@ if (!class_exists('TCPDF', false)) { // the last line must be shifted to be aligned as requested $linew = abs($this->endlinex - $startlinex); $pstart = substr($this->getPageBuffer($startlinepage), 0, $startlinepos); - if (isset($opentagpos) AND isset($this->footerlen[$startlinepage])) { + if (isset($opentagpos) AND isset($this->footerlen[$startlinepage]) AND (!$this->InFooter)) { $this->footerpos[$startlinepage] = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; $midpos = min($opentagpos, $this->footerpos[$startlinepage]); } elseif (isset($opentagpos)) { $midpos = $opentagpos; - } elseif (isset($this->footerlen[$startlinepage])) { + } elseif (isset($this->footerlen[$startlinepage]) AND (!$this->InFooter)) { $this->footerpos[$startlinepage] = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; $midpos = $this->footerpos[$startlinepage]; } else { @@ -11936,8 +11931,8 @@ if (!class_exists('TCPDF', false)) { if (($t_x != 0) OR ($yshift < 0)) { // shift the line $trx = sprintf('1 0 0 1 %.3F %.3F cm', ($t_x * $this->k), ($yshift * $this->k)); - $this->setPageBuffer($startlinepage, $pstart."\nq\n".$trx."\n".$pmid."\nQ\n".$pend); - $endlinepos = strlen($pstart."\nq\n".$trx."\n".$pmid."\nQ\n"); + $this->setPageBuffer($startlinepage, $pstart."\nq\n".$trx."\n".$pmid."\nQ\n".$pend); + $endlinepos = strlen($pstart."\nq\n".$trx."\n".$pmid."\nQ\n"); // shift the annotations and links if (isset($this->PageAnnots[$this->page])) { foreach ($this->PageAnnots[$this->page] as $pak => $pac) { @@ -12504,14 +12499,14 @@ if (!class_exists('TCPDF', false)) { $this->cMargin = $this->oldcMargin; } $this->lasth = $this->FontSize * $this->cell_height_ratio; - if (!$this->empty_string($table_el['thead']) AND !$this->empty_string($this->theadMargin)) { - // reset table header - $this->thead = ''; + if (!$this->empty_string($this->theadMargin)) { // restore top margin $this->tMargin = $this->theadMargin; $this->pagedim[$this->page]['tm'] = $this->theadMargin; - $this->theadMargin = ''; - } + } + // reset table header + $this->thead = ''; + $this->theadMargin = ''; break; } case 'a': {