From d6a2206ab366f493680a22151429f17fd045fe04 Mon Sep 17 00:00:00 2001 From: nicolaasuni Date: Thu, 29 May 2014 19:28:56 +0100 Subject: [PATCH] 6.0.083 (2014-05-29) - Bug item #928 "setHtmlVSpace with HR element" was fixed. --- CHANGELOG.TXT | 3 +++ README.TXT | 4 ++-- composer.json | 2 +- include/tcpdf_static.php | 2 +- tcpdf.php | 51 +++++++++++++++++++++++++++------------- 5 files changed, 42 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 448f9aa..1f92121 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,6 @@ +6.0.083 (2014-05-29) + - Bug item #928 "setHtmlVSpace with HR element" was fixed. + 6.0.082 (2014-05-23) - Bug item #926 "test statement instead of assignment used in tcpdf_fonts.php" was fixed. - Bug item #925 "924 transparent images bug" was fixed. diff --git a/README.TXT b/README.TXT index c4a83a4..6bf17a8 100644 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 6.0.082 -Release date: 2014-05-23 +Version: 6.0.083 +Release date: 2014-05-29 Author: Nicola Asuni Copyright (c) 2002-2014: diff --git a/composer.json b/composer.json index 8a6197b..0d2426c 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "tecnick.com/tcpdf", - "version": "6.0.082", + "version": "6.0.083", "homepage": "http://www.tcpdf.org/", "type": "library", "description": "TCPDF is a PHP class for generating PDF documents.", diff --git a/include/tcpdf_static.php b/include/tcpdf_static.php index 2492260..28c68b9 100644 --- a/include/tcpdf_static.php +++ b/include/tcpdf_static.php @@ -55,7 +55,7 @@ class TCPDF_STATIC { * Current TCPDF version. * @private static */ - private static $tcpdf_version = '6.0.082'; + private static $tcpdf_version = '6.0.083'; /** * String alias for total number of pages. diff --git a/tcpdf.php b/tcpdf.php index 1b37fbb..949459f 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,9 +1,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 6.0.082 + * @version 6.0.083 */ // TCPDF configuration @@ -128,7 +128,7 @@ require_once(dirname(__FILE__).'/include/tcpdf_static.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 6.0.082 + * @version 6.0.083 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -18682,18 +18682,18 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $cur_h = $this->getCellHeight($this->FontSize); } if (isset($this->tagvspaces[$tag['value']][0]['n'])) { - $n = $this->tagvspaces[$tag['value']][0]['n']; + $on = $this->tagvspaces[$tag['value']][0]['n']; } elseif (preg_match('/[h][0-9]/', $tag['value']) > 0) { - $n = 0.6; + $on = 0.6; } else { - $n = 1; + $on = 1; } - if ((!isset($this->tagvspaces[$tag['value']])) AND (in_array($tag['value'], array('div', 'dt', 'dd', 'li', 'br')))) { + if ((!isset($this->tagvspaces[$tag['value']])) AND (in_array($tag['value'], array('div', 'dt', 'dd', 'li', 'br', 'hr')))) { $hb = 0; } else { - $hb = ($n * $cur_h); + $hb = ($on * $cur_h); } - if (($this->htmlvspace <= 0) AND ($n > 0)) { + if (($this->htmlvspace <= 0) AND ($on > 0)) { if (isset($parent['fontsize'])) { $hbz = (($parent['fontsize'] / $this->k) * $this->cell_height_ratio); } else { @@ -18704,6 +18704,25 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: // fix vertical space after table $hbz = 0; } + // closing vertical space + $hbc = 0; + if (isset($this->tagvspaces[$tag['value']][1]['h']) AND ($this->tagvspaces[$tag['value']][1]['h'] >= 0)) { + $pre_h = $this->tagvspaces[$tag['value']][1]['h']; + } elseif (isset($parent['fontsize'])) { + $pre_h = $this->getCellHeight($parent['fontsize'] / $this->k); + } else { + $pre_h = $this->getCellHeight($this->FontSize); + } + if (isset($this->tagvspaces[$tag['value']][1]['n'])) { + $cn = $this->tagvspaces[$tag['value']][1]['n']; + } elseif (preg_match('/[h][0-9]/', $tag['value']) > 0) { + $cn = 0.6; + } else { + $cn = 1; + } + if (isset($this->tagvspaces[$tag['value']][1])) { + $hbc = ($cn * $pre_h); + } } // Opening tag switch($tag['value']) { @@ -18760,7 +18779,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: } else { $hrHeight = $this->GetLineWidth(); } - $this->addHTMLVertSpace($hbz, ($hrHeight / 2), $cell, $firsttag); + $this->addHTMLVertSpace($hbz, max($hb, ($hrHeight / 2)), $cell, $firsttag); $x = $this->GetX(); $y = $this->GetY(); $wtmp = $this->w - $this->lMargin - $this->rMargin; @@ -18776,7 +18795,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $this->SetLineWidth($hrHeight); $this->Line($x, $y, $x + $hrWidth, $y); $this->SetLineWidth($prevlinewidth); - $this->addHTMLVertSpace(($hrHeight / 2), 0, $cell, !isset($dom[($key + 1)])); + $this->addHTMLVertSpace(max($hbc, ($hrHeight / 2)), 0, $cell, !isset($dom[($key + 1)])); break; } case 'a': { @@ -19334,16 +19353,16 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $pre_h = $this->getCellHeight($this->FontSize); } if (isset($this->tagvspaces[$tag['value']][1]['n'])) { - $n = $this->tagvspaces[$tag['value']][1]['n']; + $cn = $this->tagvspaces[$tag['value']][1]['n']; } elseif (preg_match('/[h][0-9]/', $tag['value']) > 0) { - $n = 0.6; + $cn = 0.6; } else { - $n = 1; + $cn = 1; } if ((!isset($this->tagvspaces[$tag['value']])) AND ($tag['value'] == 'div')) { $hb = 0; } else { - $hb = ($n * $pre_h); + $hb = ($cn * $pre_h); } if ($maxbottomliney > $this->PageBreakTrigger) { $hbz = $this->getCellHeight($this->FontSize);