30
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-06-05 15:20:49 +00:00
This commit is contained in:
nicolaasuni 2010-01-15 12:32:16 +01:00
parent f689641f34
commit 4d48b35e1e
16 changed files with 356 additions and 272 deletions

View File

@ -1,3 +1,6 @@
4.8.023 (2010-01-15)
- Bug item #2932470 "Some HTML entities breaks justification" was fixed.
4.8.022 (2010-01-14)
- Source code documentation was fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 4.8.022
Release date: 2010-01-14
Version: 4.8.023
Release date: 2010-01-15
Author: Nicola Asuni
Copyright (c) 2001-2010:

View File

@ -45,7 +45,7 @@
<div class="credit">
<hr />
Documentation generated on Thu, 14 Jan 2010 15:02:14 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Jan 2010 12:32:01 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

File diff suppressed because it is too large Load Diff

View File

@ -1368,7 +1368,7 @@ $type)</code>
<div class="credit">
<hr />
Documentation generated on Thu, 14 Jan 2010 15:02:14 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Jan 2010 12:32:01 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -96,7 +96,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit
<div class="credit">
<hr />
Documentation generated on Thu, 14 Jan 2010 15:02:14 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Jan 2010 12:32:01 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -507,7 +507,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Thu, 14 Jan 2010 15:02:17 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Jan 2010 12:32:04 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -88,7 +88,7 @@ Array of WEB safe colors.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Thu, 14 Jan 2010 15:02:14 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Jan 2010 12:32:01 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -73,7 +73,7 @@ This is a PHP class for generating PDF documents without requiring external exte
<td><b>author:</b>&nbsp;&nbsp;</td><td>Nicola Asuni</td>
</tr>
<tr>
<td><b>version:</b>&nbsp;&nbsp;</td><td>4.8.022</td>
<td><b>version:</b>&nbsp;&nbsp;</td><td>4.8.023</td>
</tr>
<tr>
<td><b>copyright:</b>&nbsp;&nbsp;</td><td>2002-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com</td>
@ -104,7 +104,7 @@ unicode data<br /><br /></div>
<div class="tags">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>PDF_PRODUCER = 'TCPDF 4.8.022 (http://www.tcpdf.org)'</code>
<code>PDF_PRODUCER = 'TCPDF 4.8.023 (http://www.tcpdf.org)'</code>
</td></tr></table>
</td></tr></table>
@ -115,7 +115,7 @@ unicode data<br /><br /></div>
<div class="credit">
<hr />
Documentation generated on Thu, 14 Jan 2010 15:02:14 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Jan 2010 12:32:02 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -237,7 +237,7 @@ Unicode Include file for TCPDF.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Thu, 14 Jan 2010 15:02:17 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Jan 2010 12:32:04 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1229,6 +1229,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodUTF8ArrayToUniArray">TCPDF::UTF8ArrayToUniArray()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Convert an array of UTF8 values to array of unicode characters</dd>
<dt><b>UTF8ArrSubString</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodUTF8ArrSubString">TCPDF::UTF8ArrSubString()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Extract a slice of the $strarr array and return it as string.</dd>
<dt><b>UTF8ArrToLatin1</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodUTF8ArrToLatin1">TCPDF::UTF8ArrToLatin1()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Converts UTF-8 characters array to Latin1<br /></dd>
<dt><b>utf8Bidi</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodutf8Bidi">TCPDF::utf8Bidi()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Reverse the RLT substrings using the Bidirectional Algorithm (http://unicode.org/reports/tr9/).</dd>
<dt><b>UTF8StringToArray</b></dt>
@ -1448,7 +1450,7 @@
<a href="elementindex.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Thu, 14 Jan 2010 15:02:14 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Jan 2010 12:32:01 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1388,6 +1388,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodUTF8ArrayToUniArray">TCPDF::UTF8ArrayToUniArray()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Convert an array of UTF8 values to array of unicode characters</dd>
<dt><b>UTF8ArrSubString</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodUTF8ArrSubString">TCPDF::UTF8ArrSubString()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Extract a slice of the $strarr array and return it as string.</dd>
<dt><b>UTF8ArrToLatin1</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodUTF8ArrToLatin1">TCPDF::UTF8ArrToLatin1()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Converts UTF-8 characters array to Latin1<br /></dd>
<dt><b>utf8Bidi</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodutf8Bidi">TCPDF::utf8Bidi()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Reverse the RLT substrings using the Bidirectional Algorithm (http://unicode.org/reports/tr9/).</dd>
<dt><b>UTF8StringToArray</b></dt>
@ -1471,7 +1473,7 @@
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Thu, 14 Jan 2010 15:02:14 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Jan 2010 12:32:01 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -35,7 +35,7 @@
<a href="#Post-parsing">Post-parsing</a><br>
<div class="credit">
<hr />
Documentation generated on Thu, 14 Jan 2010 15:02:17 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Jan 2010 12:32:04 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -58,7 +58,7 @@
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.3</a><br />
<div class="credit">
<hr />
Documentation generated on Thu, 14 Jan 2010 15:02:14 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Jan 2010 12:32:01 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -58,7 +58,7 @@
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.3</a><br />
<div class="credit">
<hr />
Documentation generated on Thu, 14 Jan 2010 15:02:14 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Jan 2010 12:32:01 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -2,9 +2,9 @@
//============================================================+
// File name : tcpdf.php
// Begin : 2002-08-03
// Last Update : 2010-01-14
// Last Update : 2010-01-15
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
// Version : 4.8.022
// Version : 4.8.023
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
// ----------------------------------------------------------------------------
// Copyright (C) 2002-2010 Nicola Asuni - Tecnick.com S.r.l.
@ -128,7 +128,7 @@
* @copyright 2002-2010 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.8.022
* @version 4.8.023
*/
/**
@ -152,14 +152,14 @@ if (!class_exists('TCPDF', false)) {
/**
* define default PDF document producer
*/
define('PDF_PRODUCER', 'TCPDF 4.8.022 (http://www.tcpdf.org)');
define('PDF_PRODUCER', 'TCPDF 4.8.023 (http://www.tcpdf.org)');
/**
* This is a PHP class for generating PDF documents without requiring external extensions.<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>
* @name TCPDF
* @package com.tecnick.tcpdf
* @version 4.8.022
* @version 4.8.023
* @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
@ -3087,6 +3087,8 @@ if (!class_exists('TCPDF', false)) {
$prev_FontSizePt = $this->FontSizePt;
$this->SetFont($fontname, $fontstyle, $fontsize);
}
// convert UTF-8 array to Latin1 if required
$sa = $this->UTF8ArrToLatin1($sa);
$w = 0;
foreach ($sa as $char) {
$w += $this->GetCharWidth($char);
@ -3802,8 +3804,10 @@ if (!class_exists('TCPDF', false)) {
}
}
if ($txt != '') {
$txt2 = $this->_escapetext($txt);
// text lenght
$width = $this->GetStringWidth($txt);
$txwidth = $this->GetStringWidth($txt);
$width = $txwidth;
// ratio between cell lenght and text lenght
if ($width <= 0) {
$ratio = 1;
@ -3833,7 +3837,7 @@ if (!class_exists('TCPDF', false)) {
if ($this->ColorFlag) {
$s .= 'q '.$this->TextColor.' ';
}
$txt2 = $this->_escapetext($txt);
// Justification
if ($align == 'J') {
// count number of spaces
@ -3847,8 +3851,9 @@ if (!class_exists('TCPDF', false)) {
$txt2 = str_replace(chr(0).' ', ') '.($spacewidth).' (', $txt2);
} else {
// get string width
$width = $this->GetStringWidth($txt);
$width = $txwidth;
$spacewidth = (($w - $width - (2 * $this->cMargin)) / ($ns?$ns:1)) * $this->k;
// set word spacing
$rs .= sprintf('BT %.3F Tw ET ', $spacewidth);
}
$width = $w - (2 * $this->cMargin);
@ -7631,6 +7636,35 @@ if (!class_exists('TCPDF', false)) {
}
return $outstr;
}
/**
* Converts UTF-8 characters array to Latin1<br>
* @param array $unicode array containing UTF-8 unicode values
* @return array
* @author Nicola Asuni
* @access protected
* @since 4.8.023 (2010-01-15)
*/
protected function UTF8ArrToLatin1($unicode) {
global $utf8tolatin;
if ((!$this->isunicode) OR ($this->CurrentFont['type'] == 'TrueTypeUnicode') OR ($this->CurrentFont['type'] == 'cidfont0')) {
return $unicode; // string is not in unicode
}
$outarr = array(); // array to be returned
foreach ($unicode as $char) {
if ($char < 256) {
$outarr[] = $char;
} elseif (array_key_exists($char, $utf8tolatin)) {
// map from UTF-8
$outarr[] = $utf8tolatin[$char];
} elseif ($char == 0xFFFD) {
// skip
} else {
$outarr[] = 63; // '?' character
}
}
return $outarr;
}
/**
* Converts array of UTF-8 characters to UTF16-BE string.<br>