32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-26 06:17:33 +00:00
This commit is contained in:
nicolaasuni 2010-04-12 17:23:15 +02:00
parent 13a3ef412d
commit 0f5adf2041
21 changed files with 2803 additions and 2399 deletions

View File

@ -1,8 +1,11 @@
4.9.012 (2010-04-12)
- The hyphenateText() method was added to automatically hyphenate text (see example n. 46).
4.9.011 (2010-04-07)
- Vertical alignments for Cell() method were improved (see example n. 57).
4.9.010 (2010-04-06)
- Signature of Cell() method now includes a new parameters for vertical alignment (see example n. 57).
- Signature of Cell() method now includes new parameters for vertical alignment (see example n. 57).
- Text() method was extended to include all Cell() parameters.
- HTML line alignment procedure was changed to fix some bugs.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 4.9.011
Release date: 2010-04-07
Version: 4.9.012
Release date: 2010-04-12
Author: Nicola Asuni
Copyright (c) 2001-2010:

View File

@ -55,7 +55,7 @@
<div class="credit">
<hr />
Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -5548,7 +5548,7 @@ $frame)</code>
<div class="credit">
<hr />
Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:01 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -80,7 +80,7 @@ Source Location: /tcpdf.php<br /><br />
<h4>Version:</h4>
<ul>
<li>4.9.011</li>
<li>4.9.012</li>
</ul>
@ -374,6 +374,7 @@ Source Location: /tcpdf.php<br /><br />
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodgetHeaderMargin">getHeaderMargin</a></li>
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodgetHtmlDomArray">getHtmlDomArray</a></li>
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodgetHTMLUnitToUnits">getHTMLUnitToUnits</a></li>
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodgetHyphenPatternsFromTEX">getHyphenPatternsFromTEX</a></li>
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodgetImageBuffer">getImageBuffer</a></li>
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodgetImageFileType">getImageFileType</a></li>
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodgetImageRBX">getImageRBX</a></li>
@ -405,6 +406,8 @@ Source Location: /tcpdf.php<br /><br />
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodget_mqr">get_mqr</a></li>
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodGradient">Gradient</a></li>
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodHeader">Header</a></li>
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodhyphenateText">hyphenateText</a></li>
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodhyphenateWord">hyphenateWord</a></li>
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodImage">Image</a></li>
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodImageEps">ImageEps</a></li>
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodImagePngAlpha">ImagePngAlpha</a></li>
@ -662,7 +665,7 @@ This is a PHP class for generating PDF documents without requiring external exte
<td><b>author:</b>&nbsp;&nbsp;</td><td>Nicola Asuni - info@tecnick.com</td>
</tr>
<tr>
<td><b>version:</b>&nbsp;&nbsp;</td><td>4.9.011</td>
<td><b>version:</b>&nbsp;&nbsp;</td><td>4.9.012</td>
</tr>
<tr>
<td><b>link:</b>&nbsp;&nbsp;</td><td><a href="http://www.tcpdf.org">http://www.tcpdf.org</a></td>
@ -10013,6 +10016,51 @@ $point)</code>
</div><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methodgetHyphenPatternsFromTEX"></a>
<h3>method getHyphenPatternsFromTEX <span class="smalllinenumber">[line 17545]</span></h3>
<div class="function">
<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>array getHyphenPatternsFromTEX(
string
$file)</code>
</td></tr></table>
</td></tr></table><br />
Returns an array of hyphenation patterns.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>return:</b>&nbsp;&nbsp;</td><td>of hyphenation patterns</td>
</tr>
<tr>
<td><b>author:</b>&nbsp;&nbsp;</td><td>Nicola Asuni</td>
</tr>
<tr>
<td><b>since:</b>&nbsp;&nbsp;</td><td>4.9.012 (2010-04-12)</td>
</tr>
<tr>
<td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$file</b>&nbsp;&nbsp;</td>
<td>TEX file containing hypenation patterns. TEX pattrns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/</td>
</tr>
</table>
</div><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methodgetImageBuffer"></a>
<h3>method getImageBuffer <span class="smalllinenumber">[line 16711]</span></h3>
@ -11154,6 +11202,168 @@ $coords)</code>
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methodhyphenateText"></a>
<h3>method hyphenateText <span class="smalllinenumber">[line 17584]</span></h3>
<div class="function">
<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>array hyphenateText(
string
$text, mixed
$patterns, [array
$dictionary = array()], [int
$leftmin = 1], [int
$rightmin = 2], [int
$charmin = 1], [int
$charmax = 8])</code>
</td></tr></table>
</td></tr></table><br />
Returns text with soft hyphens.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>return:</b>&nbsp;&nbsp;</td><td>text with soft hyphens</td>
</tr>
<tr>
<td><b>author:</b>&nbsp;&nbsp;</td><td>Nicola Asuni</td>
</tr>
<tr>
<td><b>since:</b>&nbsp;&nbsp;</td><td>4.9.012 (2010-04-12)</td>
</tr>
<tr>
<td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$text</b>&nbsp;&nbsp;</td>
<td>text to process</td>
</tr>
<tr>
<td class="type">mixed&nbsp;&nbsp;</td>
<td><b>$patterns</b>&nbsp;&nbsp;</td>
<td>Array of hypenation patterns or a TEX file containing hypenation patterns. TEX pattrns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/</td>
</tr>
<tr>
<td class="type">array&nbsp;&nbsp;</td>
<td><b>$dictionary</b>&nbsp;&nbsp;</td>
<td>Array of words to be returned without applying the hyphenation algoritm.</td>
</tr>
<tr>
<td class="type">int&nbsp;&nbsp;</td>
<td><b>$leftmin</b>&nbsp;&nbsp;</td>
<td>Minimum number of character to leave on the left of the word without applying the hyphens.</td>
</tr>
<tr>
<td class="type">int&nbsp;&nbsp;</td>
<td><b>$rightmin</b>&nbsp;&nbsp;</td>
<td>Minimum number of character to leave on the right of the word without applying the hyphens.</td>
</tr>
<tr>
<td class="type">int&nbsp;&nbsp;</td>
<td><b>$charmin</b>&nbsp;&nbsp;</td>
<td>Minimum word lenght to apply the hyphenation algoritm.</td>
</tr>
<tr>
<td class="type">int&nbsp;&nbsp;</td>
<td><b>$charmax</b>&nbsp;&nbsp;</td>
<td>Maximum lenght of broken piece of word.</td>
</tr>
</table>
</div><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methodhyphenateWord"></a>
<h3>method hyphenateWord <span class="smalllinenumber">[line 17475]</span></h3>
<div class="function">
<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>array hyphenateWord(
array
$word, array
$patterns, [array
$dictionary = array()], [int
$leftmin = 1], [int
$rightmin = 2], [int
$charmin = 1], [int
$charmax = 8])</code>
</td></tr></table>
</td></tr></table><br />
Returns an array of chars containing soft hyphens.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>return:</b>&nbsp;&nbsp;</td><td>text with soft hyphens</td>
</tr>
<tr>
<td><b>author:</b>&nbsp;&nbsp;</td><td>Nicola Asuni</td>
</tr>
<tr>
<td><b>since:</b>&nbsp;&nbsp;</td><td>4.9.012 (2010-04-12)</td>
</tr>
<tr>
<td><b>access:</b>&nbsp;&nbsp;</td><td>protected</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">array&nbsp;&nbsp;</td>
<td><b>$word</b>&nbsp;&nbsp;</td>
<td>array of chars</td>
</tr>
<tr>
<td class="type">array&nbsp;&nbsp;</td>
<td><b>$patterns</b>&nbsp;&nbsp;</td>
<td>Array of hypenation patterns.</td>
</tr>
<tr>
<td class="type">array&nbsp;&nbsp;</td>
<td><b>$dictionary</b>&nbsp;&nbsp;</td>
<td>Array of words to be returned without applying the hyphenation algoritm.</td>
</tr>
<tr>
<td class="type">int&nbsp;&nbsp;</td>
<td><b>$leftmin</b>&nbsp;&nbsp;</td>
<td>Minimum number of character to leave on the left of the word without applying the hyphens.</td>
</tr>
<tr>
<td class="type">int&nbsp;&nbsp;</td>
<td><b>$rightmin</b>&nbsp;&nbsp;</td>
<td>Minimum number of character to leave on the right of the word without applying the hyphens.</td>
</tr>
<tr>
<td class="type">int&nbsp;&nbsp;</td>
<td><b>$charmin</b>&nbsp;&nbsp;</td>
<td>Minimum word lenght to apply the hyphenation algoritm.</td>
</tr>
<tr>
<td class="type">int&nbsp;&nbsp;</td>
<td><b>$charmax</b>&nbsp;&nbsp;</td>
<td>Maximum lenght of broken piece of word.</td>
</tr>
</table>
</div><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methodImage"></a>
<h3>method Image <span class="smalllinenumber">[line 5065]</span></h3>
@ -22281,7 +22491,7 @@ $file)</code>
<div class="credit">
<hr />
Documentation generated on Wed, 07 Apr 2010 10:00:56 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:01 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -296,7 +296,7 @@ $type)</code>
<div class="credit">
<hr />
Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1374,7 +1374,7 @@ $type)</code>
<div class="credit">
<hr />
Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -102,7 +102,7 @@ PHP class to creates array representations for 2D barcodes to be used with TCPDF
<div class="credit">
<hr />
Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -102,7 +102,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit
<div class="credit">
<hr />
Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -539,7 +539,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Wed, 07 Apr 2010 10:00:58 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -94,7 +94,7 @@ Array of WEB safe colors.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:01 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -477,7 +477,7 @@ string $string, [int $split_length = 1])</code>
<div class="credit">
<hr />
Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:01 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -79,7 +79,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.9.011</td>
<td><b>version:</b>&nbsp;&nbsp;</td><td>4.9.012</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>
@ -110,7 +110,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.9.011 (http://www.tcpdf.org)'</code>
<code>PDF_PRODUCER = 'TCPDF 4.9.012 (http://www.tcpdf.org)'</code>
</td></tr></table>
</td></tr></table>
@ -121,7 +121,7 @@ unicode data<br /><br /></div>
<div class="credit">
<hr />
Documentation generated on Wed, 07 Apr 2010 10:00:56 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:01 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -243,7 +243,7 @@ Unicode Include file for TCPDF.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Wed, 07 Apr 2010 10:00:58 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -603,6 +603,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetHtmlDomArray">TCPDF::getHtmlDomArray()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns the HTML DOM array.</dd>
<dt><b>getHTMLUnitToUnits</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetHTMLUnitToUnits">TCPDF::getHTMLUnitToUnits()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Convert HTML string containing value and unit of measure to user's units or points.</dd>
<dt><b>getHyphenPatternsFromTEX</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetHyphenPatternsFromTEX">TCPDF::getHyphenPatternsFromTEX()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns an array of hyphenation patterns.</dd>
<dt><b>getImageBuffer</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetImageBuffer">TCPDF::getImageBuffer()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Get image buffer content.</dd>
<dt><b>getImageFileType</b></dt>
@ -715,6 +717,10 @@
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodhex_to_dec">TCPDFBarcode::hex_to_dec()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Convert large hexadecimal number to decimal representation (string).</dd>
<dt><b>htmlcolors.php</b></dt>
<dd>procedural page <a href="com-tecnick-tcpdf/_htmlcolors.php.html">htmlcolors.php</a></dd>
<dt><b>hyphenateText</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodhyphenateText">TCPDF::hyphenateText()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns text with soft hyphens.</dd>
<dt><b>hyphenateWord</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodhyphenateWord">TCPDF::hyphenateWord()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns an array of chars containing soft hyphens.</dd>
</dl>
</div>
<a href="elementindex.html#top">top</a><br>
@ -1854,7 +1860,7 @@
<a href="elementindex.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -766,6 +766,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetHtmlDomArray">TCPDF::getHtmlDomArray()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns the HTML DOM array.</dd>
<dt><b>getHTMLUnitToUnits</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetHTMLUnitToUnits">TCPDF::getHTMLUnitToUnits()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Convert HTML string containing value and unit of measure to user's units or points.</dd>
<dt><b>getHyphenPatternsFromTEX</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetHyphenPatternsFromTEX">TCPDF::getHyphenPatternsFromTEX()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns an array of hyphenation patterns.</dd>
<dt><b>getImageBuffer</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetImageBuffer">TCPDF::getImageBuffer()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Get image buffer content.</dd>
<dt><b>getImageFileType</b></dt>
@ -878,6 +880,10 @@
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodhex_to_dec">TCPDFBarcode::hex_to_dec()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Convert large hexadecimal number to decimal representation (string).</dd>
<dt><b>htmlcolors.php</b></dt>
<dd>procedural page <a href="com-tecnick-tcpdf/_htmlcolors.php.html">htmlcolors.php</a></dd>
<dt><b>hyphenateText</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodhyphenateText">TCPDF::hyphenateText()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns text with soft hyphens.</dd>
<dt><b>hyphenateWord</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodhyphenateWord">TCPDF::hyphenateWord()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns an array of chars containing soft hyphens.</dd>
</dl>
</div>
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
@ -1883,7 +1889,7 @@
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 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 Wed, 07 Apr 2010 10:00:58 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -64,7 +64,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 Wed, 07 Apr 2010 10:00:55 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -64,7 +64,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 Wed, 07 Apr 2010 10:00:55 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -2,7 +2,7 @@
//============================================================+
// File name : example_046.php
// Begin : 2009-02-28
// Last Update : 2009-09-30
// Last Update : 2010-04-12
//
// Description : Example 046 for TCPDF class
// Text Hyphenation
@ -76,8 +76,6 @@ $pdf->SetFont('times', '', 10);
$pdf->AddPage();
/*
You can use an external class to automatically hyphens the text by adding the SHY characters;
Unicode Data for SHY:
Name : SOFT HYPHEN, commonly abbreviated as SHY
HTML Entity (decimal): &#173;
@ -87,7 +85,24 @@ Unicode Data for SHY:
UTF-8 (hex): 0xC2 0xAD (c2ad)
*/
// html text with soft hyphens (&shy;)
/*
// You can autmatically add SOFT HYPHENS to your text using
// the hyphenateText() method, but this requires either an
// hyphenation pattern array of a hyphenation pattern TEX file.
// You can download hyphenation TEX patterns from:
// http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/
// EXAMPLE:
$html = 'On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.';
$hyphen_patterns = $pdf->getHyphenPatternsFromTEX('../hyphens/hyph-en-gb.tex');
$html = $pdf->hyphenateText($html, $hyphen_patterns, $dictionary=array(), $leftmin=1, $rightmin=2, $charmin=1, $charmax=8);
*/
// HTML text with soft hyphens (&shy;)
$html = 'On the other hand, we de&shy;nounce with righ&shy;teous in&shy;dig&shy;na&shy;tion and dis&shy;like men who are so be&shy;guiled and de&shy;mo&shy;r&shy;al&shy;ized by the charms of plea&shy;sure of the mo&shy;ment, so blind&shy;ed by de&shy;sire, that they can&shy;not fore&shy;see the pain and trou&shy;ble that are bound to en&shy;sue; and equal blame be&shy;longs to those who fail in their du&shy;ty through weak&shy;ness of will, which is the same as say&shy;ing through shrink&shy;ing from toil and pain. Th&shy;ese cas&shy;es are per&shy;fect&shy;ly sim&shy;ple and easy to distin&shy;guish. In a free hour, when our pow&shy;er of choice is un&shy;tram&shy;melled and when noth&shy;ing pre&shy;vents our be&shy;ing able to do what we like best, ev&shy;ery plea&shy;sure is to be wel&shy;comed and ev&shy;ery pain avoid&shy;ed. But in cer&shy;tain cir&shy;cum&shy;s&shy;tances and ow&shy;ing to the claims of du&shy;ty or the obli&shy;ga&shy;tions of busi&shy;ness it will fre&shy;quent&shy;ly oc&shy;cur that plea&shy;sures have to be re&shy;pu&shy;di&shy;at&shy;ed and an&shy;noy&shy;ances ac&shy;cept&shy;ed. The wise man there&shy;fore al&shy;ways holds in th&shy;ese mat&shy;ters to this prin&shy;ci&shy;ple of se&shy;lec&shy;tion: he re&shy;jects plea&shy;sures to se&shy;cure other greater plea&shy;sures, or else he en&shy;dures pains to avoid worse pains.';
// print a cell

174
tcpdf.php
View File

@ -2,9 +2,9 @@
//============================================================+
// File name : tcpdf.php
// Begin : 2002-08-03
// Last Update : 2010-04-07
// Last Update : 2010-04-12
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
// Version : 4.9.011
// Version : 4.9.012
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
// ----------------------------------------------------------------------------
// Copyright (C) 2002-2010 Nicola Asuni - Tecnick.com S.r.l.
@ -121,7 +121,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.9.011
* @version 4.9.012
*/
/**
@ -145,14 +145,14 @@ if (!class_exists('TCPDF', false)) {
/**
* define default PDF document producer
*/
define('PDF_PRODUCER', 'TCPDF 4.9.011 (http://www.tcpdf.org)');
define('PDF_PRODUCER', 'TCPDF 4.9.012 (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.9.011
* @version 4.9.012
* @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
@ -17458,6 +17458,170 @@ if (!class_exists('TCPDF', false)) {
$this->textstrokewidth = $stroke * $this->k;
}
/**
* Returns an array of chars containing soft hyphens.
* @param array $word array of chars
* @param array $patterns Array of hypenation patterns.
* @param array $dictionary Array of words to be returned without applying the hyphenation algoritm.
* @param int $leftmin Minimum number of character to leave on the left of the word without applying the hyphens.
* @param int $rightmin Minimum number of character to leave on the right of the word without applying the hyphens.
* @param int $charmin Minimum word lenght to apply the hyphenation algoritm.
* @param int $charmax Maximum lenght of broken piece of word.
* @return array text with soft hyphens
* @author Nicola Asuni
* @since 4.9.012 (2010-04-12)
* @access protected
*/
protected function hyphenateWord($word, $patterns, $dictionary=array(), $leftmin=1, $rightmin=2, $charmin=1, $charmax=8) {
$hyphenword = array(); // hyphens positions
$numchars = count($word);
if ($numchars <= $charmin) {
return $word;
}
$word_string = $this->UTF8ArrSubString($word);
// some words will be returned as-is
$pattern = '/^([a-zA-Z0-9_\.\-]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/';
if (preg_match($pattern, $word_string) > 0) {
// email
return $word;
}
$pattern = '/(([a-zA-Z0-9\-]+\.)?)((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/';
if (preg_match($pattern, $word_string) > 0) {
// URL
return $word;
}
if (isset($dictionary[$word_string])) {
return $this->UTF8StringToArray($dictionary[$word_string]);
}
// suround word with '_' characters
$tmpword = array_merge(array(95), $word, array(95));
$tmpnumchars = $numchars + 2;
$maxpos = $tmpnumchars - $charmin;
for ($pos = 0; $pos < $maxpos; ++$pos) {
$imax = min(($tmpnumchars - $pos), $charmax);
for ($i = $charmin; $i <= $imax; ++$i) {
$subword = strtolower($this->UTF8ArrSubString($tmpword, $pos, $pos + $i));
if (isset($patterns[$subword])) {
$pattern = $this->UTF8StringToArray($patterns[$subword]);
$pattern_length = count($pattern);
$digits = 1;
for ($j = 0; $j < $pattern_length; ++$j) {
// check if $pattern[$j] is a number
if (($pattern[$j] >= 48) AND ($pattern[$j] <= 57)) {
if ($j == 0) {
$zero = $pos - 1;
} else {
$zero = $pos + $j - $digits;
}
if (!isset($hyphenword[$zero]) OR ($hyphenword[$zero] != $pattern[$j])) {
$hyphenword[$zero] = $this->unichr($pattern[$j]);
}
++$digits;
}
}
}
}
}
$inserted = 0;
$maxpos = $numchars - $rightmin;
for($i = $leftmin; $i <= $maxpos; ++$i) {
if(isset($hyphenword[$i]) AND (($hyphenword[$i] % 2) != 0)) {
// 173 = soft hyphen character
array_splice($word, $i + $inserted, 0, 173);
++$inserted;
}
}
return $word;
}
/**
* Returns an array of hyphenation patterns.
* @param string $file TEX file containing hypenation patterns. TEX pattrns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/
* @return array of hyphenation patterns
* @author Nicola Asuni
* @since 4.9.012 (2010-04-12)
* @access public
*/
public function getHyphenPatternsFromTEX($file) {
// TEX patterns are available at:
// http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/
$data = file_get_contents($file);
$patterns = array();
// remove comments
$data = preg_replace('/\%[^\n]*/', '', $data);
// extract the patterns part
preg_match('/\\\\patterns\{([^\}]*)\}/i', $data, $matches);
$data = trim(substr($matches[0], 10, -1));
// extract each pattern
$patterns_array = preg_split('/[\s]+/', $data);
// create new language array of patterns
$patterns = array();
foreach($patterns_array as $val) {
if (!$this->empty_string($val)) {
$val = trim($val);
$val = str_replace('\'', '\\\'', $val);
$key = preg_replace('/[0-9]+/', '', $val);
$patterns[$key] = $val;
}
}
return $patterns;
}
/**
* Returns text with soft hyphens.
* @param string $text text to process
* @param mixed $patterns Array of hypenation patterns or a TEX file containing hypenation patterns. TEX pattrns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/
* @param array $dictionary Array of words to be returned without applying the hyphenation algoritm.
* @param int $leftmin Minimum number of character to leave on the left of the word without applying the hyphens.
* @param int $rightmin Minimum number of character to leave on the right of the word without applying the hyphens.
* @param int $charmin Minimum word lenght to apply the hyphenation algoritm.
* @param int $charmax Maximum lenght of broken piece of word.
* @return array text with soft hyphens
* @author Nicola Asuni
* @since 4.9.012 (2010-04-12)
* @access public
*/
public function hyphenateText($text, $patterns, $dictionary=array(), $leftmin=1, $rightmin=2, $charmin=1, $charmax=8) {
global $unicode;
$text = $this->unhtmlentities($text);
$word = array(); // last word
$txtarr = array(); // text to be returned
$intag = false; // true if we are inside an HTML tag
if (!is_array($patterns)) {
$patterns = $this->getHyphenPatternsFromTEX($patterns);
}
// get array of characters
$unichars = $this->UTF8StringToArray($text);
// for each char
foreach ($unichars as $char) {
if ((!$intag) AND $unicode[$char] == 'L') {
// letter character
$word[] = $char;
} else {
// other type of character
if (!$this->empty_string($word)) {
// hypenate the word
$txtarr = array_merge($txtarr, $this->hyphenateWord($word, $patterns, $dictionary, $leftmin, $rightmin, $charmin, $charmax));
$word = array();
}
$txtarr[] = $char;
if (chr($char) == '<') {
// we are inside an HTML tag
$intag = true;
} elseif ($intag AND (chr($char) == '>')) {
// end of HTML tag
$intag = false;
}
}
}
if (!$this->empty_string($word)) {
// hypenate the word
$txtarr = array_merge($txtarr, $this->hyphenateWord($word, $patterns, $dictionary, $leftmin, $rightmin, $charmin, $charmax));
}
// convert char array to string and return
return $this->UTF8ArrSubString($txtarr);
}
} // END OF TCPDF CLASS
}
//============================================================+