32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-12-23 08:58:55 +00:00
This commit is contained in:
nicolaasuni 2009-07-20 15:44:38 +02:00
parent 532122354c
commit d5cb055a0d
16 changed files with 525 additions and 402 deletions

View File

@ -1,3 +1,9 @@
4.6.021 (2009-07-20)
- Bug item #2824015 "XHTML Ampersand & in hyperlink bug" was fixed.
- Bug item #2824036 "Image as hyperlink in table, text displaced at page break" was fixed.
- Links alignment on justified text was fixed.
- Unicode "\u" modifier was added to re_spaces variable by default.
4.6.020 (2009-07-16) 4.6.020 (2009-07-16)
- Bug item #2821921 "issue in example 18" was fixed. - Bug item #2821921 "issue in example 18" was fixed.
- Signature of SetRTL() method was changed. - Signature of SetRTL() method was changed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 4.6.020 Version: 4.6.021
Release date: 2009-07-16 Release date: 2009-07-20
Author: Nicola Asuni Author: Nicola Asuni
Copyright (c) 2001-2009: Copyright (c) 2001-2009:

View File

@ -45,7 +45,7 @@
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Thu, 16 Jul 2009 14:48:05 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 20 Jul 2009 15:44:26 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

File diff suppressed because it is too large Load Diff

View File

@ -1368,7 +1368,7 @@ $type)</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Thu, 16 Jul 2009 14:48:05 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 20 Jul 2009 15:44:26 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -96,7 +96,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 Thu, 16 Jul 2009 14:48:05 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 20 Jul 2009 15:44:26 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -507,7 +507,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Thu, 16 Jul 2009 14:48:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 20 Jul 2009 15:44:32 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -88,7 +88,7 @@ Array of WEB safe colors.<br /><br /><br /><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Thu, 16 Jul 2009 14:48:06 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 20 Jul 2009 15:44:27 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -73,7 +73,7 @@ This is a PHP class for generating PDF documents without requiring external exte
<td><b>author:</b>&nbsp;&nbsp;</td><td>Nicola Asuni</td> <td><b>author:</b>&nbsp;&nbsp;</td><td>Nicola Asuni</td>
</tr> </tr>
<tr> <tr>
<td><b>version:</b>&nbsp;&nbsp;</td><td>4.6.020</td> <td><b>version:</b>&nbsp;&nbsp;</td><td>4.6.021</td>
</tr> </tr>
<tr> <tr>
<td><b>copyright:</b>&nbsp;&nbsp;</td><td>2002-2009 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>&nbsp;&nbsp;</td><td>2002-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com</td>
@ -104,7 +104,7 @@ unicode data<br /><br /></div>
<div class="tags"> <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.6.020 (http://www.tcpdf.org)'</code> <code>PDF_PRODUCER = 'TCPDF 4.6.021 (http://www.tcpdf.org)'</code>
</td></tr></table> </td></tr></table>
</td></tr></table> </td></tr></table>
@ -115,7 +115,7 @@ unicode data<br /><br /></div>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Thu, 16 Jul 2009 14:48:06 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 20 Jul 2009 15:44:27 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -237,7 +237,7 @@ Unicode Include file for TCPDF.<br /><br /><br /><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Thu, 16 Jul 2009 14:48:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 20 Jul 2009 15:44:32 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -179,6 +179,8 @@
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$cell_height_ratio">TCPDF::$cell_height_ratio</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Default cell height ratio.</dd> <dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$cell_height_ratio">TCPDF::$cell_height_ratio</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Default cell height ratio.</dd>
<dt><b>$cMargin</b></dt> <dt><b>$cMargin</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$cMargin">TCPDF::$cMargin</a></dd> <dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$cMargin">TCPDF::$cMargin</a></dd>
<dt><b>$cntmrk</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$cntmrk">TCPDF::$cntmrk</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Array used to store content positions inside the pages buffer.</dd>
<dt><b>$ColorFlag</b></dt> <dt><b>$ColorFlag</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$ColorFlag">TCPDF::$ColorFlag</a></dd> <dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$ColorFlag">TCPDF::$ColorFlag</a></dd>
<dt><b>$compress</b></dt> <dt><b>$compress</b></dt>
@ -919,6 +921,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetCellPadding">TCPDF::SetCellPadding()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the internal Cell padding.</dd> <dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetCellPadding">TCPDF::SetCellPadding()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the internal Cell padding.</dd>
<dt><b>SetCompression</b></dt> <dt><b>SetCompression</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetCompression">TCPDF::SetCompression()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Activates or deactivates page compression. When activated, the internal representation of each page is compressed, which leads to a compression ratio of about 2 for the resulting document. Compression is on by default.</dd> <dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetCompression">TCPDF::SetCompression()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Activates or deactivates page compression. When activated, the internal representation of each page is compressed, which leads to a compression ratio of about 2 for the resulting document. Compression is on by default.</dd>
<dt><b>setContentMark</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetContentMark">TCPDF::setContentMark()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set start-writing mark on selected page.</dd>
<dt><b>SetCreator</b></dt> <dt><b>SetCreator</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetCreator">TCPDF::SetCreator()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Defines the creator of the document. This is typically the name of the application that generates the PDF.</dd> <dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetCreator">TCPDF::SetCreator()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Defines the creator of the document. This is typically the name of the application that generates the PDF.</dd>
<dt><b>SetDefaultMonospacedFont</b></dt> <dt><b>SetDefaultMonospacedFont</b></dt>
@ -1368,7 +1372,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 Thu, 16 Jul 2009 14:48:05 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 20 Jul 2009 15:44:26 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -330,6 +330,8 @@
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$cell_height_ratio">TCPDF::$cell_height_ratio</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Default cell height ratio.</dd> <dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$cell_height_ratio">TCPDF::$cell_height_ratio</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Default cell height ratio.</dd>
<dt><b>$cMargin</b></dt> <dt><b>$cMargin</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$cMargin">TCPDF::$cMargin</a></dd> <dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$cMargin">TCPDF::$cMargin</a></dd>
<dt><b>$cntmrk</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$cntmrk">TCPDF::$cntmrk</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Array used to store content positions inside the pages buffer.</dd>
<dt><b>$ColorFlag</b></dt> <dt><b>$ColorFlag</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$ColorFlag">TCPDF::$ColorFlag</a></dd> <dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$ColorFlag">TCPDF::$ColorFlag</a></dd>
<dt><b>$compress</b></dt> <dt><b>$compress</b></dt>
@ -1070,6 +1072,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetCellPadding">TCPDF::SetCellPadding()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the internal Cell padding.</dd> <dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetCellPadding">TCPDF::SetCellPadding()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the internal Cell padding.</dd>
<dt><b>SetCompression</b></dt> <dt><b>SetCompression</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetCompression">TCPDF::SetCompression()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Activates or deactivates page compression. When activated, the internal representation of each page is compressed, which leads to a compression ratio of about 2 for the resulting document. Compression is on by default.</dd> <dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetCompression">TCPDF::SetCompression()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Activates or deactivates page compression. When activated, the internal representation of each page is compressed, which leads to a compression ratio of about 2 for the resulting document. Compression is on by default.</dd>
<dt><b>setContentMark</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetContentMark">TCPDF::setContentMark()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set start-writing mark on selected page.</dd>
<dt><b>SetCreator</b></dt> <dt><b>SetCreator</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetCreator">TCPDF::SetCreator()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Defines the creator of the document. This is typically the name of the application that generates the PDF.</dd> <dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetCreator">TCPDF::SetCreator()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Defines the creator of the document. This is typically the name of the application that generates the PDF.</dd>
<dt><b>SetDefaultMonospacedFont</b></dt> <dt><b>SetDefaultMonospacedFont</b></dt>
@ -1391,7 +1395,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 Thu, 16 Jul 2009 14:48:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 20 Jul 2009 15:44:26 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -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 Thu, 16 Jul 2009 14:48:15 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 20 Jul 2009 15:44:32 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -58,7 +58,7 @@
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.1</a><br /> This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.1</a><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Thu, 16 Jul 2009 14:48:05 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 20 Jul 2009 15:44:26 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -58,7 +58,7 @@
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.1</a><br /> This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.1</a><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Thu, 16 Jul 2009 14:48:05 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 20 Jul 2009 15:44:26 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

109
tcpdf.php
View File

@ -2,9 +2,9 @@
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2009-07-16 // Last Update : 2009-07-20
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org // Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
// Version : 4.6.020 // Version : 4.6.021
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html) // License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Copyright (C) 2002-2009 Nicola Asuni - Tecnick.com S.r.l. // Copyright (C) 2002-2009 Nicola Asuni - Tecnick.com S.r.l.
@ -126,7 +126,7 @@
* @copyright 2002-2009 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-2009 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.6.020 * @version 4.6.021
*/ */
/** /**
@ -150,14 +150,14 @@ if (!class_exists('TCPDF', false)) {
/** /**
* define default PDF document producer * define default PDF document producer
*/ */
define('PDF_PRODUCER', 'TCPDF 4.6.020 (http://www.tcpdf.org)'); define('PDF_PRODUCER', 'TCPDF 4.6.021 (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.6.020 * @version 4.6.021
* @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
@ -974,7 +974,15 @@ if (!class_exists('TCPDF', false)) {
* @access protected * @access protected
* @since 3.2.000 (2008-06-26) * @since 3.2.000 (2008-06-26)
*/ */
protected $intmrk = array(); protected $intmrk = array();
/**
* Array used to store content positions inside the pages buffer.
* keys are the page numbers
* @access protected
* @since 4.6.021 (2009-07-20)
*/
protected $cntmrk = array();
/** /**
* Array used to store footer positions of each page. * Array used to store footer positions of each page.
@ -1087,7 +1095,7 @@ if (!class_exists('TCPDF', false)) {
* @access protected * @access protected
* @since 4.2.000 (2008-10-29) * @since 4.2.000 (2008-10-29)
*/ */
protected $feps = 0.001; protected $feps = 0.005;
/** /**
* Array used for custom vertical spaces for HTML tags * Array used for custom vertical spaces for HTML tags
@ -1319,8 +1327,8 @@ if (!class_exists('TCPDF', false)) {
} }
// set disk caching // set disk caching
$this->diskcache = $diskcache ? true : false; $this->diskcache = $diskcache ? true : false;
// set language direction // set language direction
$this->rtl = $this->l['a_meta_dir']=='rtl' ? true : false; $this->rtl = false;
$this->tmprtl = false; $this->tmprtl = false;
//Some checks //Some checks
$this->_dochecks(); $this->_dochecks();
@ -1419,8 +1427,8 @@ if (!class_exists('TCPDF', false)) {
// \p{Z} or \p{Separator}: any kind of Unicode whitespace or invisible separator. // \p{Z} or \p{Separator}: any kind of Unicode whitespace or invisible separator.
// \p{Lo} or \p{Other_Letter}: a Unicode letter or ideograph that does not have lowercase and uppercase variants. // \p{Lo} or \p{Other_Letter}: a Unicode letter or ideograph that does not have lowercase and uppercase variants.
// \p{Lo} is needed because Chinese characters are packed next to each other without spaces in between. // \p{Lo} is needed because Chinese characters are packed next to each other without spaces in between.
//$this->re_spaces = '/[\s\p{Z}\p{Lo}]/'; //$this->re_spaces = '/[\s\p{Z}\p{Lo}]/u';
$this->re_spaces = '/[\s\p{Z}]/'; $this->re_spaces = '/[\s\p{Z}]/u';
} else { } else {
// PCRE unicode support is turned OFF // PCRE unicode support is turned OFF
$this->re_spaces = '/[\s]/'; $this->re_spaces = '/[\s]/';
@ -2241,9 +2249,27 @@ if (!class_exists('TCPDF', false)) {
* @since 4.0.016 (2008-07-30) * @since 4.0.016 (2008-07-30)
*/ */
public function setPageMark() { public function setPageMark() {
$this->intmrk[$this->page] = $this->pagelen[$this->page]; $this->intmrk[$this->page] = $this->pagelen[$this->page];
$this->setContentMark();
} }
/**
* Set start-writing mark on selected page.
* @param int $page page number (default is the current page)
* @access protected
* @since 4.6.021 (2009-07-20)
*/
protected function setContentMark($page=0) {
if ($page <= 0) {
$page = $this->page;
}
if (isset($this->footerlen[$page])) {
$this->cntmrk[$page] = $this->pagelen[$page] - $this->footerlen[$page];
} else {
$this->cntmrk[$page] = $this->pagelen[$page];
}
}
/** /**
* Set header data. * Set header data.
* @param string $ln header image logo * @param string $ln header image logo
@ -3819,7 +3845,8 @@ if (!class_exists('TCPDF', false)) {
$this->setPage($startpage); $this->setPage($startpage);
$this->y = $y; $this->y = $y;
$this->SetX($x + $w); $this->SetX($x + $w);
} }
$this->setContentMark();
return $nl; return $nl;
} }
@ -4564,7 +4591,7 @@ if (!class_exists('TCPDF', false)) {
$this->x = $bx; $this->x = $bx;
$this->y = $by; $this->y = $by;
} }
if ($link) { if ($link) {
$this->Link($ximg, $y, $w, $h, $link, 0); $this->Link($ximg, $y, $w, $h, $link, 0);
} }
// set pointer to align the successive text/objects // set pointer to align the successive text/objects
@ -5530,7 +5557,7 @@ if (!class_exists('TCPDF', false)) {
case 'link': { case 'link': {
if(is_string($pl['txt'])) { if(is_string($pl['txt'])) {
// external URI link // external URI link
$annots .= ' /A <</S /URI /URI '.$this->_datastring($pl['txt']).'>>'; $annots .= ' /A <</S /URI /URI '.$this->_datastring($this->unhtmlentities($pl['txt'])).'>>';
} else { } else {
// internal link // internal link
$l = $this->links[$pl['txt']]; $l = $this->links[$pl['txt']];
@ -5683,7 +5710,6 @@ if (!class_exists('TCPDF', false)) {
break; break;
} }
} }
$annots .= '>>'; $annots .= '>>';
} }
$annots .= "\n]"; $annots .= "\n]";
@ -6911,8 +6937,12 @@ if (!class_exists('TCPDF', false)) {
* @since 1.1 * @since 1.1
*/ */
public function setLanguageArray($language) { public function setLanguageArray($language) {
$this->l = $language; $this->l = $language;
$this->rtl = $this->l['a_meta_dir']=='rtl' ? true : false; if (isset($this->l['a_meta_dir'])) {
$this->rtl = $this->l['a_meta_dir']=='rtl' ? true : false;
} else {
$this->rtl = false;
}
} }
/** /**
@ -7595,7 +7625,7 @@ if (!class_exists('TCPDF', false)) {
if (isset($dash)) { if (isset($dash)) {
$dash_string = ''; $dash_string = '';
if ($dash) { if ($dash) {
if (ereg('^.+,', $dash)) { if (preg_match('/^.+,/', $dash) > 0) {
$tab = explode(',', $dash); $tab = explode(',', $dash);
} else { } else {
$tab = array($dash); $tab = array($dash);
@ -11062,7 +11092,7 @@ if (!class_exists('TCPDF', false)) {
if (isset($dom[$key]['style']['font-family'])) { if (isset($dom[$key]['style']['font-family'])) {
// font family // font family
if (isset($dom[$key]['style']['font-family'])) { if (isset($dom[$key]['style']['font-family'])) {
$fontslist = split(',', strtolower($dom[$key]['style']['font-family'])); $fontslist = preg_split('/[,]/', strtolower($dom[$key]['style']['font-family']));
foreach ($fontslist as $font) { foreach ($fontslist as $font) {
$font = trim(strtolower($font)); $font = trim(strtolower($font));
if (in_array($font, $this->fontlist) OR in_array($font, $this->fontkeys)) { if (in_array($font, $this->fontlist) OR in_array($font, $this->fontkeys)) {
@ -11176,7 +11206,7 @@ if (!class_exists('TCPDF', false)) {
if ($dom[$key]['value'] == 'font') { if ($dom[$key]['value'] == 'font') {
// font family // font family
if (isset($dom[$key]['attribute']['face'])) { if (isset($dom[$key]['attribute']['face'])) {
$fontslist = split(',', strtolower($dom[$key]['attribute']['face'])); $fontslist = preg_split('/[,]/', strtolower($dom[$key]['attribute']['face']));
foreach ($fontslist as $font) { foreach ($fontslist as $font) {
$font = trim(strtolower($font)); $font = trim(strtolower($font));
if (in_array($font, $this->fontlist) OR in_array($font, $this->fontkeys)) { if (in_array($font, $this->fontlist) OR in_array($font, $this->fontkeys)) {
@ -11377,7 +11407,7 @@ if (!class_exists('TCPDF', false)) {
$this->checkPageBreak($imgh); $this->checkPageBreak($imgh);
} }
if ($this->page > $startlinepage) { if ($this->page > $startlinepage) {
// fix lines splitted over two pages // fix line splitted over two pages
if (isset($this->footerlen[$startlinepage])) { if (isset($this->footerlen[$startlinepage])) {
$curpos = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; $curpos = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage];
} }
@ -11386,34 +11416,39 @@ if (!class_exists('TCPDF', false)) {
$linebeg = substr($pagebuff, $startlinepos, ($curpos - $startlinepos)); $linebeg = substr($pagebuff, $startlinepos, ($curpos - $startlinepos));
$tstart = substr($pagebuff, 0, $startlinepos); $tstart = substr($pagebuff, 0, $startlinepos);
$tend = substr($this->getPageBuffer($startlinepage), $curpos); $tend = substr($this->getPageBuffer($startlinepage), $curpos);
// remove line start from previous page // remove line from previous page
$this->setPageBuffer($startlinepage, $tstart.''.$tend); $this->setPageBuffer($startlinepage, $tstart.''.$tend);
$pagebuff = $this->getPageBuffer($this->page); $pagebuff = $this->getPageBuffer($this->page);
$tstart = substr($pagebuff, 0, $this->intmrk[$this->page]); $tstart = substr($pagebuff, 0, $this->cntmrk[$this->page]);
$tend = substr($pagebuff, $this->intmrk[$this->page]); $tend = substr($pagebuff, $this->cntmrk[$this->page]);
// add line start to current page // add line start to current page
$yshift = $minstartliney - $this->y; $yshift = $minstartliney - $this->y;
$try = sprintf('1 0 0 1 0 %.3F cm', ($yshift * $this->k)); $try = sprintf('1 0 0 1 0 %.3F cm', ($yshift * $this->k));
$this->setPageBuffer($this->page, $tstart."\nq\n".$try."\n".$linebeg."\nQ\n".$tend); $this->setPageBuffer($this->page, $tstart."\nq\n".$try."\n".$linebeg."\nQ\n".$tend);
// shift the annotations and links // shift the annotations and links
if (isset($this->PageAnnots[$this->page])) {
$next_pask = count($this->PageAnnots[$this->page]);
} else {
$next_pask = 0;
}
if (isset($this->PageAnnots[$startlinepage])) { if (isset($this->PageAnnots[$startlinepage])) {
foreach ($this->PageAnnots[$startlinepage] as $pak => $pac) { foreach ($this->PageAnnots[$startlinepage] as $pak => $pac) {
if ($pak >= $pask) { if ($pak >= $pask) {
$this->PageAnnots[$this->page][] = $pac; $this->PageAnnots[$this->page][] = $pac;
unset($this->PageAnnots[$startlinepage][$pak]); unset($this->PageAnnots[$startlinepage][$pak]);
$npak = count($this->PageAnnots[$this->page]) - 1; $npak = count($this->PageAnnots[$this->page]) - 1;
$this->PageAnnots[$this->page][$npak]['y'] -= $yshift; $this->PageAnnots[$this->page][$npak]['y'] -= $yshift;
} }
} }
} }
$startlinepos = $this->intmrk[$this->page]; $pask = $next_pask;
$startlinepos = $this->cntmrk[$this->page];
$startlinepage = $this->page; $startlinepage = $this->page;
$startliney = $this->y; $startliney = $this->y;
} }
$this->y += (($curfontsize / $this->k) - $imgh); $this->y += (($curfontsize / $this->k) - $imgh);
$minstartliney = min($this->y, $minstartliney); $minstartliney = min($this->y, $minstartliney);
} elseif (isset($dom[$key]['fontname']) OR isset($dom[$key]['fontstyle']) OR isset($dom[$key]['fontsize'])) { } elseif (isset($dom[$key]['fontname']) OR isset($dom[$key]['fontstyle']) OR isset($dom[$key]['fontsize'])) {
// account for different font size // account for different font size
$pfontname = $curfontname; $pfontname = $curfontname;
@ -11443,13 +11478,18 @@ if (!class_exists('TCPDF', false)) {
// remove line start from previous page // remove line start from previous page
$this->setPageBuffer($startlinepage, $tstart.''.$tend); $this->setPageBuffer($startlinepage, $tstart.''.$tend);
$pagebuff = $this->getPageBuffer($this->page); $pagebuff = $this->getPageBuffer($this->page);
$tstart = substr($pagebuff, 0, $this->intmrk[$this->page]); $tstart = substr($pagebuff, 0, $this->cntmrk[$this->page]);
$tend = substr($pagebuff, $this->intmrk[$this->page]); $tend = substr($pagebuff, $this->cntmrk[$this->page]);
// add line start to current page // add line start to current page
$yshift = $minstartliney - $this->y; $yshift = $minstartliney - $this->y;
$try = sprintf('1 0 0 1 0 %.3F cm', ($yshift * $this->k)); $try = sprintf('1 0 0 1 0 %.3F cm', ($yshift * $this->k));
$this->setPageBuffer($this->page, $tstart."\nq\n".$try."\n".$linebeg."\nQ\n".$tend); $this->setPageBuffer($this->page, $tstart."\nq\n".$try."\n".$linebeg."\nQ\n".$tend);
// shift the annotations and links // shift the annotations and links
if (isset($this->PageAnnots[$this->page])) {
$next_pask = count($this->PageAnnots[$this->page]);
} else {
$next_pask = 0;
}
if (isset($this->PageAnnots[$startlinepage])) { if (isset($this->PageAnnots[$startlinepage])) {
foreach ($this->PageAnnots[$startlinepage] as $pak => $pac) { foreach ($this->PageAnnots[$startlinepage] as $pak => $pac) {
if ($pak >= $pask) { if ($pak >= $pask) {
@ -11460,6 +11500,7 @@ if (!class_exists('TCPDF', false)) {
} }
} }
} }
$pask = $next_pask;
} }
$this->y += (($curfontsize - $fontsize) / $this->k); $this->y += (($curfontsize - $fontsize) / $this->k);
$minstartliney = min($this->y, $minstartliney); $minstartliney = min($this->y, $minstartliney);