32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-26 14:26:28 +00:00

6.0.054 (2014-01-13)

- Bug #877 "Parenteses causing corrupt text" was fixed.
This commit is contained in:
nicolaasuni 2014-01-13 18:14:28 +00:00
parent 4a7678a1ad
commit 9c04ada91f
5 changed files with 23 additions and 14 deletions

View File

@ -1,3 +1,6 @@
6.0.054 (2014-01-13)
- Bug #877 "Parenteses causing corrupt text" was fixed.
6.0.053 (2014-01-03) 6.0.053 (2014-01-03)
- Bug #876 "Cell padding should not be multiplied with number of lines in getStringHeight" was fixed. - Bug #876 "Cell padding should not be multiplied with number of lines in getStringHeight" was fixed.
- Patch #68 "Empty img src attribute leads to access of uninitialized string offset" was applied. - Patch #68 "Empty img src attribute leads to access of uninitialized string offset" was applied.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 6.0.053 Version: 6.0.054
Release date: 2014-01-03 Release date: 2014-01-13
Author: Nicola Asuni Author: Nicola Asuni
Copyright (c) 2002-2014: Copyright (c) 2002-2014:

View File

@ -1,6 +1,6 @@
{ {
"name": "tecnick.com/tcpdf", "name": "tecnick.com/tcpdf",
"version": "6.0.053", "version": "6.0.054",
"homepage": "http://www.tcpdf.org/", "homepage": "http://www.tcpdf.org/",
"type": "library", "type": "library",
"description": "TCPDF is a PHP class for generating PDF documents.", "description": "TCPDF is a PHP class for generating PDF documents.",

View File

@ -2,7 +2,7 @@
//============================================================+ //============================================================+
// File name : example_039.php // File name : example_039.php
// Begin : 2008-10-16 // Begin : 2008-10-16
// Last Update : 2013-05-14 // Last Update : 2014-01-13
// //
// Description : Example 039 for TCPDF class // Description : Example 039 for TCPDF class
// HTML justification // HTML justification
@ -75,7 +75,7 @@ $pdf->SetFont('helvetica', 'B', 20);
$pdf->Write(0, 'Example of HTML Justification', '', 0, 'L', true, 0, false, false, 0); $pdf->Write(0, 'Example of HTML Justification', '', 0, 'L', true, 0, false, false, 0);
// create some HTML content // create some HTML content
$html = '<span style="text-align:justify;">a <u>abc</u> abcdefghijkl abcdef abcdefg <b>abcdefghi</b> a abc abcd <img src="images/logo_example.png" border="0" height="41" width="41" /> <img src="images/tiger.ai" alt="test alt attribute" width="100" height="100" border="0" /> abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a <u>abc</u> abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg abcdefghi a abc abcd <a href="http://tcpdf.org">abcdef abcdefg</a> start a abc before <span style="background-color:yellow">yellow color</span> after a abc abcd abcdef abcdefg abcdefghi a abc abcd end abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi<br />abcd abcdef abcdefg abcdefghi<br />abcd abcde abcdef</span>'; $html = '<span style="text-align:justify;">a <u>abc</u> abcdefghijkl (abcdef) abcdefg <b>abcdefghi</b> a ((abc)) abcd <img src="images/logo_example.png" border="0" height="41" width="41" /> <img src="images/tiger.ai" alt="test alt attribute" width="100" height="100" border="0" /> abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a <u>abc</u> abcd abcdef abcdefg <b>abcdefghi</b> a abc \(abcd\) abcdef abcdefg <b>abcdefghi</b> a abc \\\(abcd\\\) abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg abcdefghi a abc abcd <a href="http://tcpdf.org">abcdef abcdefg</a> start a abc before <span style="background-color:yellow">yellow color</span> after a abc abcd abcdef abcdefg abcdefghi a abc abcd end abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi<br />abcd abcdef abcdefg abcdefghi<br />abcd abcde abcdef</span>';
// set core font // set core font
$pdf->SetFont('helvetica', '', 10); $pdf->SetFont('helvetica', '', 10);

View File

@ -1,9 +1,9 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Version : 6.0.053 // Version : 6.0.054
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2014-01-03 // Last Update : 2014-01-13
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -104,7 +104,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 6.0.053 * @version 6.0.054
*/ */
// TCPDF configuration // 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.<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 6.0.053 * @version 6.0.054
* @author Nicola Asuni - info@tecnick.com * @author Nicola Asuni - info@tecnick.com
*/ */
class TCPDF { class TCPDF {
@ -6226,7 +6226,7 @@ class TCPDF {
} }
$this->adjustCellPadding($border); $this->adjustCellPadding($border);
$lines = $this->getNumLines($txt, $w, $reseth, $autopadding, $cellpadding, $border); $lines = $this->getNumLines($txt, $w, $reseth, $autopadding, $cellpadding, $border);
$height = $this->getCellHeight(($lines * $this->FontSize), $autopadding); $height = $lines * $this->getCellHeight($this->FontSize, $autopadding);
$this->cell_padding = $prev_cell_padding; $this->cell_padding = $prev_cell_padding;
$this->lasth = $prev_lasth; $this->lasth = $prev_lasth;
return $height; return $height;
@ -17768,14 +17768,20 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$spacew /= ($this->font_stretching / 100); $spacew /= ($this->font_stretching / 100);
} }
// escape special characters // escape special characters
$pos = 0;
$pmid = preg_replace('/[\\\][\(]/x', '\\#!#OP#!#', $pmid); $pmid = preg_replace('/[\\\][\(]/x', '\\#!#OP#!#', $pmid);
$pmid = preg_replace('/[\\\][\)]/x', '\\#!#CP#!#', $pmid); $pmid = preg_replace('/[\\\][\)]/x', '\\#!#CP#!#', $pmid);
if (preg_match_all('/\[\(([^\)]*)\)\]/x', $pmid, $pamatch) > 0) { if (preg_match_all('/\[\(([^\)]*)\)\]/x', $pmid, $pamatch) > 0) {
foreach($pamatch[0] as $pk => $pmatch) { foreach($pamatch[0] as $pk => $pmatch) {
$pmatch = str_replace('#!#OP#!#', '(', $pmatch); $replace = $pamatch[1][$pk];
$pmatch = str_replace('#!#CP#!#', ')', $pmatch); $replace = str_replace('#!#OP#!#', '(', $replace);
$newpmid = '[('.str_replace(chr(0).chr(32), ') '.sprintf('%F', $spacew).' (', $pamatch[1][$pk]).')]'; $replace = str_replace('#!#CP#!#', ')', $replace);
$pmid = str_replace($pmatch, $newpmid, $pmid); $newpmid = '[('.str_replace(chr(0).chr(32), ') '.sprintf('%F', $spacew).' (', $replace).')]';
$pos = strpos($pmid, $pmatch, $pos);
if ($pos !== FALSE) {
$pmid = substr_replace($pmid, $newpmid, $pos, strlen($pmatch));
}
++$pos;
} }
unset($pamatch); unset($pamatch);
} }