mirror of
https://github.com/vdm-io/tcpdf.git
synced 2024-11-29 23:53:54 +00:00
4.9.012
This commit is contained in:
parent
13a3ef412d
commit
0f5adf2041
@ -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)
|
4.9.011 (2010-04-07)
|
||||||
- Vertical alignments for Cell() method were improved (see example n. 57).
|
- Vertical alignments for Cell() method were improved (see example n. 57).
|
||||||
|
|
||||||
4.9.010 (2010-04-06)
|
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.
|
- Text() method was extended to include all Cell() parameters.
|
||||||
- HTML line alignment procedure was changed to fix some bugs.
|
- HTML line alignment procedure was changed to fix some bugs.
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
|
|||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
|
|
||||||
Name: TCPDF
|
Name: TCPDF
|
||||||
Version: 4.9.011
|
Version: 4.9.012
|
||||||
Release date: 2010-04-07
|
Release date: 2010-04-12
|
||||||
Author: Nicola Asuni
|
Author: Nicola Asuni
|
||||||
|
|
||||||
Copyright (c) 2001-2010:
|
Copyright (c) 2001-2010:
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -5548,7 +5548,7 @@ $frame)</code>
|
|||||||
|
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -80,7 +80,7 @@ Source Location: /tcpdf.php<br /><br />
|
|||||||
|
|
||||||
<h4>Version:</h4>
|
<h4>Version:</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li>4.9.011</li>
|
<li>4.9.012</li>
|
||||||
</ul>
|
</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#methodgetHeaderMargin">getHeaderMargin</a></li>
|
||||||
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodgetHtmlDomArray">getHtmlDomArray</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#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#methodgetImageBuffer">getImageBuffer</a></li>
|
||||||
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodgetImageFileType">getImageFileType</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>
|
<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#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#methodGradient">Gradient</a></li>
|
||||||
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodHeader">Header</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#methodImage">Image</a></li>
|
||||||
<li><a href="../com-tecnick-tcpdf/TCPDF.html#methodImageEps">ImageEps</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>
|
<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> </td><td>Nicola Asuni - info@tecnick.com</td>
|
<td><b>author:</b> </td><td>Nicola Asuni - info@tecnick.com</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>version:</b> </td><td>4.9.011</td>
|
<td><b>version:</b> </td><td>4.9.012</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>link:</b> </td><td><a href="http://www.tcpdf.org">http://www.tcpdf.org</a></td>
|
<td><b>link:</b> </td><td><a href="http://www.tcpdf.org">http://www.tcpdf.org</a></td>
|
||||||
@ -10013,6 +10016,51 @@ $point)</code>
|
|||||||
</div><br />
|
</div><br />
|
||||||
<div class="top">[ <a href="#top">Top</a> ]</div>
|
<div class="top">[ <a href="#top">Top</a> ]</div>
|
||||||
</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> </td><td>of hyphenation patterns</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>author:</b> </td><td>Nicola Asuni</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>since:</b> </td><td>4.9.012 (2010-04-12)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>access:</b> </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 </td>
|
||||||
|
<td><b>$file</b> </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 />
|
<hr />
|
||||||
<a name="methodgetImageBuffer"></a>
|
<a name="methodgetImageBuffer"></a>
|
||||||
<h3>method getImageBuffer <span class="smalllinenumber">[line 16711]</span></h3>
|
<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 class="top">[ <a href="#top">Top</a> ]</div>
|
||||||
</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> </td><td>text with soft hyphens</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>author:</b> </td><td>Nicola Asuni</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>since:</b> </td><td>4.9.012 (2010-04-12)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>access:</b> </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 </td>
|
||||||
|
<td><b>$text</b> </td>
|
||||||
|
<td>text to process</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="type">mixed </td>
|
||||||
|
<td><b>$patterns</b> </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 </td>
|
||||||
|
<td><b>$dictionary</b> </td>
|
||||||
|
<td>Array of words to be returned without applying the hyphenation algoritm.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="type">int </td>
|
||||||
|
<td><b>$leftmin</b> </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 </td>
|
||||||
|
<td><b>$rightmin</b> </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 </td>
|
||||||
|
<td><b>$charmin</b> </td>
|
||||||
|
<td>Minimum word lenght to apply the hyphenation algoritm.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="type">int </td>
|
||||||
|
<td><b>$charmax</b> </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> </td><td>text with soft hyphens</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>author:</b> </td><td>Nicola Asuni</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>since:</b> </td><td>4.9.012 (2010-04-12)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>access:</b> </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 </td>
|
||||||
|
<td><b>$word</b> </td>
|
||||||
|
<td>array of chars</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="type">array </td>
|
||||||
|
<td><b>$patterns</b> </td>
|
||||||
|
<td>Array of hypenation patterns.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="type">array </td>
|
||||||
|
<td><b>$dictionary</b> </td>
|
||||||
|
<td>Array of words to be returned without applying the hyphenation algoritm.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="type">int </td>
|
||||||
|
<td><b>$leftmin</b> </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 </td>
|
||||||
|
<td><b>$rightmin</b> </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 </td>
|
||||||
|
<td><b>$charmin</b> </td>
|
||||||
|
<td>Minimum word lenght to apply the hyphenation algoritm.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="type">int </td>
|
||||||
|
<td><b>$charmax</b> </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 />
|
<hr />
|
||||||
<a name="methodImage"></a>
|
<a name="methodImage"></a>
|
||||||
<h3>method Image <span class="smalllinenumber">[line 5065]</span></h3>
|
<h3>method Image <span class="smalllinenumber">[line 5065]</span></h3>
|
||||||
@ -22281,7 +22491,7 @@ $file)</code>
|
|||||||
|
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -296,7 +296,7 @@ $type)</code>
|
|||||||
|
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -1374,7 +1374,7 @@ $type)</code>
|
|||||||
|
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -102,7 +102,7 @@ PHP class to creates array representations for 2D barcodes to be used with TCPDF
|
|||||||
|
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -102,7 +102,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit
|
|||||||
|
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -539,7 +539,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
|
|||||||
|
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -94,7 +94,7 @@ Array of WEB safe colors.<br /><br /><br /><br />
|
|||||||
|
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -477,7 +477,7 @@ string $string, [int $split_length = 1])</code>
|
|||||||
|
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -79,7 +79,7 @@ This is a PHP class for generating PDF documents without requiring external exte
|
|||||||
<td><b>author:</b> </td><td>Nicola Asuni</td>
|
<td><b>author:</b> </td><td>Nicola Asuni</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>version:</b> </td><td>4.9.011</td>
|
<td><b>version:</b> </td><td>4.9.012</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>copyright:</b> </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>
|
<td><b>copyright:</b> </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">
|
<div class="tags">
|
||||||
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
|
<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">
|
<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>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ unicode data<br /><br /></div>
|
|||||||
|
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -243,7 +243,7 @@ Unicode Include file for TCPDF.<br /><br /><br /><br />
|
|||||||
|
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -603,6 +603,8 @@
|
|||||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetHtmlDomArray">TCPDF::getHtmlDomArray()</a><br> Returns the HTML DOM array.</dd>
|
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetHtmlDomArray">TCPDF::getHtmlDomArray()</a><br> Returns the HTML DOM array.</dd>
|
||||||
<dt><b>getHTMLUnitToUnits</b></dt>
|
<dt><b>getHTMLUnitToUnits</b></dt>
|
||||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetHTMLUnitToUnits">TCPDF::getHTMLUnitToUnits()</a><br> Convert HTML string containing value and unit of measure to user's units or points.</dd>
|
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetHTMLUnitToUnits">TCPDF::getHTMLUnitToUnits()</a><br> 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> Returns an array of hyphenation patterns.</dd>
|
||||||
<dt><b>getImageBuffer</b></dt>
|
<dt><b>getImageBuffer</b></dt>
|
||||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetImageBuffer">TCPDF::getImageBuffer()</a><br> Get image buffer content.</dd>
|
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetImageBuffer">TCPDF::getImageBuffer()</a><br> Get image buffer content.</dd>
|
||||||
<dt><b>getImageFileType</b></dt>
|
<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> Convert large hexadecimal number to decimal representation (string).</dd>
|
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodhex_to_dec">TCPDFBarcode::hex_to_dec()</a><br> Convert large hexadecimal number to decimal representation (string).</dd>
|
||||||
<dt><b>htmlcolors.php</b></dt>
|
<dt><b>htmlcolors.php</b></dt>
|
||||||
<dd>procedural page <a href="com-tecnick-tcpdf/_htmlcolors.php.html">htmlcolors.php</a></dd>
|
<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> 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> Returns an array of chars containing soft hyphens.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<a href="elementindex.html#top">top</a><br>
|
<a href="elementindex.html#top">top</a><br>
|
||||||
@ -1854,7 +1860,7 @@
|
|||||||
<a href="elementindex.html#top">top</a><br>
|
<a href="elementindex.html#top">top</a><br>
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -766,6 +766,8 @@
|
|||||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetHtmlDomArray">TCPDF::getHtmlDomArray()</a><br> Returns the HTML DOM array.</dd>
|
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetHtmlDomArray">TCPDF::getHtmlDomArray()</a><br> Returns the HTML DOM array.</dd>
|
||||||
<dt><b>getHTMLUnitToUnits</b></dt>
|
<dt><b>getHTMLUnitToUnits</b></dt>
|
||||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetHTMLUnitToUnits">TCPDF::getHTMLUnitToUnits()</a><br> Convert HTML string containing value and unit of measure to user's units or points.</dd>
|
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetHTMLUnitToUnits">TCPDF::getHTMLUnitToUnits()</a><br> 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> Returns an array of hyphenation patterns.</dd>
|
||||||
<dt><b>getImageBuffer</b></dt>
|
<dt><b>getImageBuffer</b></dt>
|
||||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetImageBuffer">TCPDF::getImageBuffer()</a><br> Get image buffer content.</dd>
|
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetImageBuffer">TCPDF::getImageBuffer()</a><br> Get image buffer content.</dd>
|
||||||
<dt><b>getImageFileType</b></dt>
|
<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> Convert large hexadecimal number to decimal representation (string).</dd>
|
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodhex_to_dec">TCPDFBarcode::hex_to_dec()</a><br> Convert large hexadecimal number to decimal representation (string).</dd>
|
||||||
<dt><b>htmlcolors.php</b></dt>
|
<dt><b>htmlcolors.php</b></dt>
|
||||||
<dd>procedural page <a href="com-tecnick-tcpdf/_htmlcolors.php.html">htmlcolors.php</a></dd>
|
<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> 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> Returns an array of chars containing soft hyphens.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
|
<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>
|
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<a href="#Post-parsing">Post-parsing</a><br>
|
<a href="#Post-parsing">Post-parsing</a><br>
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.3</a><br />
|
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.3</a><br />
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.3</a><br />
|
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.3</a><br />
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//============================================================+
|
//============================================================+
|
||||||
// File name : example_046.php
|
// File name : example_046.php
|
||||||
// Begin : 2009-02-28
|
// Begin : 2009-02-28
|
||||||
// Last Update : 2009-09-30
|
// Last Update : 2010-04-12
|
||||||
//
|
//
|
||||||
// Description : Example 046 for TCPDF class
|
// Description : Example 046 for TCPDF class
|
||||||
// Text Hyphenation
|
// Text Hyphenation
|
||||||
@ -76,8 +76,6 @@ $pdf->SetFont('times', '', 10);
|
|||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
You can use an external class to automatically hyphens the text by adding the SHY characters;
|
|
||||||
|
|
||||||
Unicode Data for SHY:
|
Unicode Data for SHY:
|
||||||
Name : SOFT HYPHEN, commonly abbreviated as SHY
|
Name : SOFT HYPHEN, commonly abbreviated as SHY
|
||||||
HTML Entity (decimal): ­
|
HTML Entity (decimal): ­
|
||||||
@ -87,7 +85,24 @@ Unicode Data for SHY:
|
|||||||
UTF-8 (hex): 0xC2 0xAD (c2ad)
|
UTF-8 (hex): 0xC2 0xAD (c2ad)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// html text with soft hyphens (­)
|
/*
|
||||||
|
// 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 (­)
|
||||||
$html = 'On the other hand, we de­nounce with righ­teous in­dig­na­tion and dis­like men who are so be­guiled and de­mo­r­al­ized by the charms of plea­sure of the mo­ment, so blind­ed by de­sire, that they can­not fore­see the pain and trou­ble that are bound to en­sue; and equal blame be­longs to those who fail in their du­ty through weak­ness of will, which is the same as say­ing through shrink­ing from toil and pain. Th­ese cas­es are per­fect­ly sim­ple and easy to distin­guish. In a free hour, when our pow­er of choice is un­tram­melled and when noth­ing pre­vents our be­ing able to do what we like best, ev­ery plea­sure is to be wel­comed and ev­ery pain avoid­ed. But in cer­tain cir­cum­s­tances and ow­ing to the claims of du­ty or the obli­ga­tions of busi­ness it will fre­quent­ly oc­cur that plea­sures have to be re­pu­di­at­ed and an­noy­ances ac­cept­ed. The wise man there­fore al­ways holds in th­ese mat­ters to this prin­ci­ple of se­lec­tion: he re­jects plea­sures to se­cure other greater plea­sures, or else he en­dures pains to avoid worse pains.';
|
$html = 'On the other hand, we de­nounce with righ­teous in­dig­na­tion and dis­like men who are so be­guiled and de­mo­r­al­ized by the charms of plea­sure of the mo­ment, so blind­ed by de­sire, that they can­not fore­see the pain and trou­ble that are bound to en­sue; and equal blame be­longs to those who fail in their du­ty through weak­ness of will, which is the same as say­ing through shrink­ing from toil and pain. Th­ese cas­es are per­fect­ly sim­ple and easy to distin­guish. In a free hour, when our pow­er of choice is un­tram­melled and when noth­ing pre­vents our be­ing able to do what we like best, ev­ery plea­sure is to be wel­comed and ev­ery pain avoid­ed. But in cer­tain cir­cum­s­tances and ow­ing to the claims of du­ty or the obli­ga­tions of busi­ness it will fre­quent­ly oc­cur that plea­sures have to be re­pu­di­at­ed and an­noy­ances ac­cept­ed. The wise man there­fore al­ways holds in th­ese mat­ters to this prin­ci­ple of se­lec­tion: he re­jects plea­sures to se­cure other greater plea­sures, or else he en­dures pains to avoid worse pains.';
|
||||||
|
|
||||||
// print a cell
|
// print a cell
|
||||||
|
174
tcpdf.php
174
tcpdf.php
@ -2,9 +2,9 @@
|
|||||||
//============================================================+
|
//============================================================+
|
||||||
// File name : tcpdf.php
|
// File name : tcpdf.php
|
||||||
// Begin : 2002-08-03
|
// Begin : 2002-08-03
|
||||||
// Last Update : 2010-04-07
|
// Last Update : 2010-04-12
|
||||||
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
|
// 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)
|
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Copyright (C) 2002-2010 Nicola Asuni - Tecnick.com S.r.l.
|
// 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
|
* @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
|
* @link http://www.tcpdf.org
|
||||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL
|
* @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 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>
|
* 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>
|
* 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
|
* @name TCPDF
|
||||||
* @package com.tecnick.tcpdf
|
* @package com.tecnick.tcpdf
|
||||||
* @version 4.9.011
|
* @version 4.9.012
|
||||||
* @author Nicola Asuni - info@tecnick.com
|
* @author Nicola Asuni - info@tecnick.com
|
||||||
* @link http://www.tcpdf.org
|
* @link http://www.tcpdf.org
|
||||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL
|
* @license http://www.gnu.org/copyleft/lesser.html LGPL
|
||||||
@ -17458,6 +17458,170 @@ if (!class_exists('TCPDF', false)) {
|
|||||||
$this->textstrokewidth = $stroke * $this->k;
|
$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
|
} // END OF TCPDF CLASS
|
||||||
}
|
}
|
||||||
//============================================================+
|
//============================================================+
|
||||||
|
Loading…
Reference in New Issue
Block a user