32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-25 22:07:33 +00:00
This commit is contained in:
nicolaasuni 2010-04-20 12:13:47 +02:00
parent a6b8529152
commit eff7f0e36e
21 changed files with 883 additions and 571 deletions

View File

@ -1,3 +1,9 @@
4.9.015 (2010-04-20)
- A new method copyPage() was added to clone pages (see example n. 44).
- Support for text overline was added.
- Underline and linethrough methods were fixed.
- Bug #2989058 "SHY character causes unnecessary word-wrapping" was fixed.
4.9.014 (2010-04-18)
- Bug item #2988845 was fixed.

View File

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

View File

@ -55,7 +55,7 @@
<div class="credit">
<hr />
Documentation generated on Sun, 18 Apr 2010 14:02:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:32 +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 Sun, 18 Apr 2010 14:02:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:32 +0200 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

@ -296,7 +296,7 @@ $type)</code>
<div class="credit">
<hr />
Documentation generated on Sun, 18 Apr 2010 14:02:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:32 +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 Sun, 18 Apr 2010 14:02:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:32 +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 Sun, 18 Apr 2010 14:02:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:32 +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 Sun, 18 Apr 2010 14:02:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:32 +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 Sun, 18 Apr 2010 14:02:33 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:35 +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 Sun, 18 Apr 2010 14:02:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:32 +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 Sun, 18 Apr 2010 14:02:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:32 +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.014</td>
<td><b>version:</b>&nbsp;&nbsp;</td><td>4.9.015</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.014 (http://www.tcpdf.org)'</code>
<code>PDF_PRODUCER = 'TCPDF 4.9.015 (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 Sun, 18 Apr 2010 14:02:31 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:33 +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 Sun, 18 Apr 2010 14:02:33 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:35 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -311,6 +311,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodconvertHTMLColorToDec">TCPDF::convertHTMLColorToDec()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns an associative array (keys: R,G,B) from an html color name or a six-digit or three-digit hexadecimal color representation (i.e. #3FE5AA or #7FF).</dd>
<dt><b>CoonsPatchMesh</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodCoonsPatchMesh">TCPDF::CoonsPatchMesh()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Paints a coons patch mesh.</dd>
<dt><b>copyPage</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodcopyPage">TCPDF::copyPage()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Clone the specified page to a new page.</dd>
<dt><b>createBitStream</b></dt>
<dd>in file qrcode.php, method <a href="com-tecnick-tcpdf/QRcode.html#methodcreateBitStream">QRcode::createBitStream()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;createBitStream</dd>
<dt><b>createFrame</b></dt>
@ -1047,6 +1049,8 @@
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$outlines">TCPDF::$outlines</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Outlines for bookmark</dd>
<dt><b>$Ovalue</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$Ovalue">TCPDF::$Ovalue</a><br>&nbsp;&nbsp;&nbsp;&nbsp;O entry in pdf document</dd>
<dt><b>$overline</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$overline">TCPDF::$overline</a></dd>
<dt><b>objclone</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodobjclone">TCPDF::objclone()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Creates a copy of a class object</dd>
<dt><b>Open</b></dt>
@ -1737,6 +1741,10 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#method_dolinethrough">TCPDF::_dolinethrough()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Line through text.</dd>
<dt><b>_dolinethroughw</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#method_dolinethroughw">TCPDF::_dolinethroughw()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Line through for rectangular text area.</dd>
<dt><b>_dooverline</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#method_dooverline">TCPDF::_dooverline()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Overline text.</dd>
<dt><b>_dooverlinew</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#method_dooverlinew">TCPDF::_dooverlinew()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Overline for rectangular text area.</dd>
<dt><b>_dounderline</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#method_dounderline">TCPDF::_dounderline()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Underline text.</dd>
<dt><b>_dounderlinew</b></dt>
@ -1860,7 +1868,7 @@
<a href="elementindex.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Sun, 18 Apr 2010 14:02:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:32 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -112,6 +112,10 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#method_dolinethrough">TCPDF::_dolinethrough()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Line through text.</dd>
<dt><b>_dolinethroughw</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#method_dolinethroughw">TCPDF::_dolinethroughw()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Line through for rectangular text area.</dd>
<dt><b>_dooverline</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#method_dooverline">TCPDF::_dooverline()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Overline text.</dd>
<dt><b>_dooverlinew</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#method_dooverlinew">TCPDF::_dooverlinew()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Overline for rectangular text area.</dd>
<dt><b>_dounderline</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#method_dounderline">TCPDF::_dounderline()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Underline text.</dd>
<dt><b>_dounderlinew</b></dt>
@ -474,6 +478,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodconvertHTMLColorToDec">TCPDF::convertHTMLColorToDec()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns an associative array (keys: R,G,B) from an html color name or a six-digit or three-digit hexadecimal color representation (i.e. #3FE5AA or #7FF).</dd>
<dt><b>CoonsPatchMesh</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodCoonsPatchMesh">TCPDF::CoonsPatchMesh()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Paints a coons patch mesh.</dd>
<dt><b>copyPage</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodcopyPage">TCPDF::copyPage()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Clone the specified page to a new page.</dd>
<dt><b>createBitStream</b></dt>
<dd>in file qrcode.php, method <a href="com-tecnick-tcpdf/QRcode.html#methodcreateBitStream">QRcode::createBitStream()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;createBitStream</dd>
<dt><b>createFrame</b></dt>
@ -1210,6 +1216,8 @@
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$outlines">TCPDF::$outlines</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Outlines for bookmark</dd>
<dt><b>$Ovalue</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$Ovalue">TCPDF::$Ovalue</a><br>&nbsp;&nbsp;&nbsp;&nbsp;O entry in pdf document</dd>
<dt><b>$overline</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$overline">TCPDF::$overline</a></dd>
<dt><b>objclone</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodobjclone">TCPDF::objclone()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Creates a copy of a class object</dd>
<dt><b>Open</b></dt>
@ -1889,7 +1897,7 @@
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Sun, 18 Apr 2010 14:02:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:31 +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 Sun, 18 Apr 2010 14:02:33 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:35 +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 Sun, 18 Apr 2010 14:02:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:32 +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 Sun, 18 Apr 2010 14:02:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 20 Apr 2010 12:13:32 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -2,13 +2,13 @@
//============================================================+
// File name : example_044.php
// Begin : 2009-01-02
// Last Update : 2009-09-30
//
// Last Update : 2010-04-20
//
// Description : Example 044 for TCPDF class
// Move and delete pages
//
// Move, copy and delete pages
//
// Author: Nicola Asuni
//
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
@ -22,7 +22,7 @@
/**
* Creates an example PDF TEST document using TCPDF
* @package com.tecnick.tcpdf
* @abstract TCPDF - Example: Move and delete pages
* @abstract TCPDF - Example: Move, copy and delete pages
* @author Nicola Asuni
* @copyright 2004-2008 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://tcpdf.org
@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
@ -106,6 +106,9 @@ $pdf->deletePage(6);
$pdf->AddPage();
$pdf->Cell(0, 10, 'PAGE H', 0, 1, 'L');
// copy the second page
$pdf->copyPage(2);
// NOTE: to insert a page to a previous position, you can add a new page to the end of document and then move it using movePage().
// ---------------------------------------------------------
@ -114,6 +117,6 @@ $pdf->Cell(0, 10, 'PAGE H', 0, 1, 'L');
$pdf->Output('example_044.pdf', 'I');
//============================================================+
// END OF FILE
// END OF FILE
//============================================================+
?>

174
tcpdf.php
View File

@ -2,9 +2,9 @@
//============================================================+
// File name : tcpdf.php
// Begin : 2002-08-03
// Last Update : 2010-04-18
// Last Update : 2010-04-19
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
// Version : 4.9.014
// Version : 4.9.015
// 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.014
* @version 4.9.015
*/
/**
@ -145,14 +145,14 @@ if (!class_exists('TCPDF', false)) {
/**
* define default PDF document producer
*/
define('PDF_PRODUCER', 'TCPDF 4.9.014 (http://www.tcpdf.org)');
define('PDF_PRODUCER', 'TCPDF 4.9.015 (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.014
* @version 4.9.015
* @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
@ -392,6 +392,12 @@ if (!class_exists('TCPDF', false)) {
*/
protected $underline;
/**
* @var overlining flag
* @access protected
*/
protected $overline;
/**
* @var current font info
* @access protected
@ -1593,6 +1599,7 @@ if (!class_exists('TCPDF', false)) {
$this->FontStyle = '';
$this->FontSizePt = 12;
$this->underline = false;
$this->overline = false;
$this->linethrough = false;
$this->DrawColor = '0 G';
$this->FillColor = '0 g';
@ -2356,7 +2363,7 @@ if (!class_exists('TCPDF', false)) {
/**
* Move pointer at the specified document page and update page dimensions.
* @param int $pnum page number
* @param int $pnum page number (1 ... numpages)
* @param boolean $resetmargins if true reset left, right, top margins and Y position.
* @access public
* @since 2.1.000 (2008-01-07)
@ -3138,7 +3145,7 @@ if (!class_exists('TCPDF', false)) {
* Returns the length of a string in user unit. A font must be selected.<br>
* @param string $s The string whose length is to be computed
* @param string $fontname Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained.
* @param string $fontstyle Font style. Possible values are (case insensitive):<ul><li>empty string: regular</li><li>B: bold</li><li>I: italic</li><li>U: underline</li><li>D: line trough</li></ul> or any combination. The default value is regular.
* @param string $fontstyle Font style. Possible values are (case insensitive):<ul><li>empty string: regular</li><li>B: bold</li><li>I: italic</li><li>U: underline</li><li>D: line-trough</li><li>O: overline</li></ul> or any combination. The default value is regular.
* @param float $fontsize Font size in points. The default value is the current size.
* @param boolean $getarray if true returns an array of characters widths, if false returns the total length.
* @return mixed int total string length or array of characted widths
@ -3154,7 +3161,7 @@ if (!class_exists('TCPDF', false)) {
* Returns the string length of an array of chars in user unit or an array of characters widths. A font must be selected.<br>
* @param string $sa The array of chars whose total length is to be computed
* @param string $fontname Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained.
* @param string $fontstyle Font style. Possible values are (case insensitive):<ul><li>empty string: regular</li><li>B: bold</li><li>I: italic</li><li>U: underline</li><li>D: line trough</li></ul> or any combination. The default value is regular.
* @param string $fontstyle Font style. Possible values are (case insensitive):<ul><li>empty string: regular</li><li>B: bold</li><li>I: italic</li><li>U: underline</li><li>D: line trough</li><li>O: overline</li></ul> or any combination. The default value is regular.
* @param float $fontsize Font size in points. The default value is the current size.
* @param boolean $getarray if true returns an array of characters widths, if false returns the total length.
* @return mixed int total string length or array of characted widths
@ -3282,12 +3289,18 @@ if (!class_exists('TCPDF', false)) {
} else {
$this->underline = false;
}
// line through (deleted)
// line-through (deleted)
if (strpos($tempstyle, 'D') !== false) {
$this->linethrough = true;
} else {
$this->linethrough = false;
}
// overline
if (strpos($tempstyle, 'O') !== false) {
$this->overline = true;
} else {
$this->overline = false;
}
// bold
if (strpos($tempstyle, 'B') !== false) {
$style .= 'B';
@ -3298,7 +3311,7 @@ if (!class_exists('TCPDF', false)) {
}
$bistyle = $style;
$fontkey = $family.$style;
$font_style = $style.($this->underline ? 'U' : '').($this->linethrough ? 'D' : '');
$font_style = $style.($this->underline ? 'U' : '').($this->linethrough ? 'D' : '').($this->overline ? 'O' : '');
$fontdata = array('fontkey' => $fontkey, 'family' => $family, 'style' => $font_style);
// check if the font has been already added
if ($this->getFontBuffer($fontkey) !== false) {
@ -3450,7 +3463,7 @@ if (!class_exists('TCPDF', false)) {
* If you just wish to change the current font size, it is simpler to call SetFontSize().
* Note: for the standard fonts, the font metric files must be accessible. There are three possibilities for this:<ul><li>They are in the current directory (the one where the running script lies)</li><li>They are in one of the directories defined by the include_path parameter</li><li>They are in the directory defined by the K_PATH_FONTS constant</li></ul><br />
* @param string $family Family font. It can be either a name defined by AddFont() or one of the standard Type1 families (case insensitive):<ul><li>times (Times-Roman)</li><li>timesb (Times-Bold)</li><li>timesi (Times-Italic)</li><li>timesbi (Times-BoldItalic)</li><li>helvetica (Helvetica)</li><li>helveticab (Helvetica-Bold)</li><li>helveticai (Helvetica-Oblique)</li><li>helveticabi (Helvetica-BoldOblique)</li><li>courier (Courier)</li><li>courierb (Courier-Bold)</li><li>courieri (Courier-Oblique)</li><li>courierbi (Courier-BoldOblique)</li><li>symbol (Symbol)</li><li>zapfdingbats (ZapfDingbats)</li></ul> It is also possible to pass an empty string. In that case, the current family is retained.
* @param string $style Font style. Possible values are (case insensitive):<ul><li>empty string: regular</li><li>B: bold</li><li>I: italic</li><li>U: underline</li><li>D: line trough</li></ul> or any combination. The default value is regular. Bold and italic styles do not apply to Symbol and ZapfDingbats basic fonts or other fonts when not defined.
* @param string $style Font style. Possible values are (case insensitive):<ul><li>empty string: regular</li><li>B: bold</li><li>I: italic</li><li>U: underline</li><li>D: line trough</li><li>O: overline</li></ul> or any combination. The default value is regular. Bold and italic styles do not apply to Symbol and ZapfDingbats basic fonts or other fonts when not defined.
* @param float $size Font size in points. The default value is the current size. If no size has been specified since the beginning of the document, the value taken is 12
* @param string $fontfile The font definition file. By default, the name is built from the family and style, in lower case with no spaces.
* @access public
@ -4219,6 +4232,9 @@ if (!class_exists('TCPDF', false)) {
if ($this->linethrough) {
$s .= ' '.$this->_dolinethroughw($xdx, $basefonty, $width);
}
if ($this->overline) {
$s .= ' '.$this->_dooverlinew($xdx, $basefonty, $width);
}
if ($this->ColorFlag) {
$s .= ' Q';
}
@ -4642,6 +4658,7 @@ if (!class_exists('TCPDF', false)) {
if (($maxh > 0) AND ($this->y >= $maxy) ) {
break;
}
$shy = false;
//Get the current character
$c = $chars[$i];
if ($c == 10) { // 10 = "\n" = new line
@ -6293,7 +6310,7 @@ if (!class_exists('TCPDF', false)) {
}
//$annots .= ' /StructParent ';
//$annots .= ' /OC ';
$markups = array('text', 'freetext', 'line', 'square', 'circle', 'polygon', 'polyline', 'highlight', 'underline', 'squiggly', 'strikeout', 'stamp', 'caret', 'ink', 'fileattachment', 'sound');
$markups = array('text', 'freetext', 'line', 'square', 'circle', 'polygon', 'polyline', 'highlight', 'underline', 'squiggly', 'strikeout', 'stamp', 'caret', 'ink', 'fileattachment', 'sound');
if (in_array(strtolower($pl['opt']['subtype']), $markups)) {
// this is a markup type
if (isset($pl['opt']['t']) AND is_string($pl['opt']['t'])) {
@ -7691,6 +7708,19 @@ if (!class_exists('TCPDF', false)) {
return $this->_dounderlinew($x, $y, $w);
}
/**
* Underline for rectangular text area.
* @param int $x X coordinate
* @param int $y Y coordinate
* @param int $w width to underline
* @access protected
* @since 4.8.008 (2009-09-29)
*/
protected function _dounderlinew($x, $y, $w) {
$linew = - $this->CurrentFont['ut'] / 1000 * $this->FontSizePt;
return sprintf('%.2F %.2F %.2F %.2F re f', $x * $this->k, ($this->h - $y + ($linew / 2)) * $this->k, $w * $this->k, $linew);
}
/**
* Line through text.
* @param int $x X coordinate
@ -7703,32 +7733,44 @@ if (!class_exists('TCPDF', false)) {
return $this->_dolinethroughw($x, $y, $w);
}
/**
* Underline for rectangular text area.
* @param int $x X coordinate
* @param int $y Y coordinate
* @param int $w width to underline
* @access protected
* @since 4.8.008 (2009-09-29)
*/
protected function _dounderlinew($x, $y, $w) {
$up = $this->CurrentFont['up'];
$ut = $this->CurrentFont['ut'];
return sprintf('%.2F %.2F %.2F %.2F re f', $x * $this->k, ($this->h - ($y - $up / 1000 * $this->FontSize)) * $this->k, $w * $this->k, -$ut / 1000 * $this->FontSizePt);
}
/**
* Line through for rectangular text area.
* @param int $x X coordinate
* @param int $y Y coordinate
* @param string $txt text to linethrough
* @access protected
* @since 4.8.008 (2009-09-29)
* @since 4.9.008 (2009-09-29)
*/
protected function _dolinethroughw($x, $y, $w) {
$up = $this->CurrentFont['up'];
$ut = $this->CurrentFont['ut'];
return sprintf('%.2F %.2F %.2F %.2F re f', $x * $this->k, ($this->h - ($y - ($this->FontSize/2) - $up / 1000 * $this->FontSize)) * $this->k, $w * $this->k, -$ut / 1000 * $this->FontSizePt);
$linew = - $this->CurrentFont['ut'] / 1000 * $this->FontSizePt;
return sprintf('%.2F %.2F %.2F %.2F re f', $x * $this->k, ($this->h - $y + ($this->FontSize / 3) + ($linew / 2)) * $this->k, $w * $this->k, $linew);
}
/**
* Overline text.
* @param int $x X coordinate
* @param int $y Y coordinate
* @param string $txt text to overline
* @access protected
* @since 4.9.015 (2010-04-19)
*/
protected function _dooverline($x, $y, $txt) {
$w = $this->GetStringWidth($txt);
return $this->_dooverlinew($x, $y, $w);
}
/**
* Overline for rectangular text area.
* @param int $x X coordinate
* @param int $y Y coordinate
* @param int $w width to overline
* @access protected
* @since 4.9.015 (2010-04-19)
*/
protected function _dooverlinew($x, $y, $w) {
$linew = - $this->CurrentFont['ut'] / 1000 * $this->FontSizePt;
return sprintf('%.2F %.2F %.2F %.2F re f', $x * $this->k, ($this->h - $y + $this->FontAscent - ($linew / 2)) * $this->k, $w * $this->k, $linew);
}
/**
@ -13675,9 +13717,14 @@ if (!class_exists('TCPDF', false)) {
$dec = trim($dec);
if (!$this->empty_string($dec)) {
if ($dec{0} == 'u') {
// underline
$dom[$key]['fontstyle'] .= 'U';
} elseif ($dec{0} == 'l') {
// line-trough
$dom[$key]['fontstyle'] .= 'D';
} elseif ($dec{0} == 'o') {
// overline
$dom[$key]['fontstyle'] .= 'O';
}
}
}
@ -15161,9 +15208,14 @@ if (!class_exists('TCPDF', false)) {
$dec = trim($dec);
if (!$this->empty_string($dec)) {
if ($dec{0} == 'u') {
// underline
$this->HREF['style'] .= 'U';
} elseif ($dec{0} == 'l') {
// line-trough
$this->HREF['style'] .= 'D';
} elseif ($dec{0} == 'o') {
// overline
$this->HREF['style'] .= 'O';
}
}
}
@ -16364,7 +16416,6 @@ if (!class_exists('TCPDF', false)) {
break;
}
// ordered types
// $this->listcount[$this->listnum];
// $textitem
case '1':
@ -17038,6 +17089,67 @@ if (!class_exists('TCPDF', false)) {
return true;
}
/**
* Clone the specified page to a new page.
* @param int $page number of page to copy (0 = current page)
* @return true in case of success, false in case of error.
* @access public
* @since 4.9.015 (2010-04-20)
*/
public function copyPage($page=0) {
if ($page == 0) {
// default value
$page = $this->page;
}
if ($page > $this->numpages) {
return false;
}
if ($page == $this->page) {
// close the page before cloning it
$this->endPage();
}
// copy all page-related states
++$this->numpages;
$this->page = $this->numpages;
$this->pages[$this->page] = $this->pages[$page];
$this->pagedim[$this->page] = $this->pagedim[$page];
$this->pagelen[$this->page] = $this->pagelen[$page];
$this->intmrk[$this->page] = $this->intmrk[$page];
$this->pageopen[$this->page] = false;
if (isset($this->footerpos[$page])) {
$this->footerpos[$this->page] = $this->footerpos[$page];
}
if (isset($this->footerlen[$page])) {
$this->footerlen[$this->page] = $this->footerlen[$page];
}
if (isset($this->transfmrk[$page])) {
$this->transfmrk[$this->page] = $this->transfmrk[$page];
}
if (isset($this->PageAnnots[$page])) {
$this->PageAnnots[$this->page] = $this->PageAnnots[$page];
}
if (isset($this->newpagegroup[$page])) {
$this->newpagegroup[$this->page] = $this->newpagegroup[$page];
}
// copy outlines
$tmpoutlines = $this->outlines;
foreach ($tmpoutlines as $key => $outline) {
if ($outline['p'] == $page) {
$this->outlines[] = array('t' => $outline['t'], 'l' => $outline['l'], 'y' => $outline['y'], 'p' => $this->page);
}
}
// copy links
$tmplinks = $this->links;
foreach ($tmplinks as $key => $link) {
if ($link[0] == $page) {
$this->links[] = array($this->page, $link[1]);
}
}
// return to last page
$this->lastPage(true);
return true;
}
/**
* Output a Table of Content Index (TOC).
* After calling this method you have to call addPage() to add other content.