mirror of
https://github.com/vdm-io/tcpdf.git
synced 2024-12-23 17:08:53 +00:00
4.6.014
This commit is contained in:
parent
16fd2654c0
commit
b3da98b92e
@ -1,3 +1,7 @@
|
|||||||
|
4.6.014 (2009-06-04)
|
||||||
|
- Bug #2800931 "Table thead tag bug" was fixed.
|
||||||
|
- A bug related to <pre> tag was fixed.
|
||||||
|
|
||||||
4.6.013 (2009-05-28)
|
4.6.013 (2009-05-28)
|
||||||
- List bullets position was fixed for RTL languages.
|
- List bullets position was fixed for RTL languages.
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
|
|||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
|
|
||||||
Name: TCPDF
|
Name: TCPDF
|
||||||
Version: 4.6.013
|
Version: 4.6.014
|
||||||
Release date: 2009-05-28
|
Release date: 2009-06-04
|
||||||
Author: Nicola Asuni
|
Author: Nicola Asuni
|
||||||
|
|
||||||
Copyright (c) 2001-2009:
|
Copyright (c) 2001-2009:
|
||||||
@ -57,7 +57,7 @@ Main Features:
|
|||||||
Installation (full instructions on http://www.tcpdf.org):
|
Installation (full instructions on http://www.tcpdf.org):
|
||||||
1. copy the folder on your Web server
|
1. copy the folder on your Web server
|
||||||
2. set your installation path and other parameters on the config/tcpdf_config.php
|
2. set your installation path and other parameters on the config/tcpdf_config.php
|
||||||
3. call the example/example_001.php page with your browser to see an example
|
3. call the examples/example_001.php page with your browser to see an example
|
||||||
|
|
||||||
Source Code Documentation:
|
Source Code Documentation:
|
||||||
doc/index.html
|
doc/index.html
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<hr />
|
||||||
Documentation generated on Thu, 28 May 2009 19:14:09 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
Documentation generated on Thu, 04 Jun 2009 14:29:39 +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
@ -1368,7 +1368,7 @@ $type)</code>
|
|||||||
|
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<hr />
|
||||||
Documentation generated on Thu, 28 May 2009 19:14:09 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
Documentation generated on Thu, 04 Jun 2009 14:29:39 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
||||||
</div>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -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, 28 May 2009 19:14:09 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
Documentation generated on Thu, 04 Jun 2009 14:29:39 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
||||||
</div>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -507,7 +507,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
|
|||||||
|
|
||||||
<div class="credit">
|
<div class="credit">
|
||||||
<hr />
|
<hr />
|
||||||
Documentation generated on Thu, 28 May 2009 19:14:15 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
Documentation generated on Thu, 04 Jun 2009 14:29:45 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
||||||
</div>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -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, 28 May 2009 19:14:09 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
Documentation generated on Thu, 04 Jun 2009 14:29:39 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
||||||
</div>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -73,7 +73,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.6.013</td>
|
<td><b>version:</b> </td><td>4.6.014</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>copyright:</b> </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> </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.013 (http://www.tcpdf.org)'</code>
|
<code>PDF_PRODUCER = 'TCPDF 4.6.014 (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, 28 May 2009 19:14:09 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
Documentation generated on Thu, 04 Jun 2009 14:29:39 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
||||||
</div>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -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, 28 May 2009 19:14:15 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
Documentation generated on Thu, 04 Jun 2009 14:29:45 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
||||||
</div>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -1087,8 +1087,8 @@
|
|||||||
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$TextColor">TCPDF::$TextColor</a></dd>
|
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$TextColor">TCPDF::$TextColor</a></dd>
|
||||||
<dt><b>$thead</b></dt>
|
<dt><b>$thead</b></dt>
|
||||||
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$thead">TCPDF::$thead</a><br> Table header content to be repeated on each new page</dd>
|
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$thead">TCPDF::$thead</a><br> Table header content to be repeated on each new page</dd>
|
||||||
<dt><b>$theadMargin</b></dt>
|
<dt><b>$theadMargins</b></dt>
|
||||||
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$theadMargin">TCPDF::$theadMargin</a><br> Distance between the top of page and end of table headers on a new page.</dd>
|
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$theadMargins">TCPDF::$theadMargins</a><br> Margins used for table header.</dd>
|
||||||
<dt><b>$title</b></dt>
|
<dt><b>$title</b></dt>
|
||||||
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$title">TCPDF::$title</a></dd>
|
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$title">TCPDF::$title</a></dd>
|
||||||
<dt><b>$tMargin</b></dt>
|
<dt><b>$tMargin</b></dt>
|
||||||
@ -1364,7 +1364,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, 28 May 2009 19:14:09 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
Documentation generated on Thu, 04 Jun 2009 14:29:39 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
||||||
</div>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -1238,8 +1238,8 @@
|
|||||||
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$TextColor">TCPDF::$TextColor</a></dd>
|
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$TextColor">TCPDF::$TextColor</a></dd>
|
||||||
<dt><b>$thead</b></dt>
|
<dt><b>$thead</b></dt>
|
||||||
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$thead">TCPDF::$thead</a><br> Table header content to be repeated on each new page</dd>
|
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$thead">TCPDF::$thead</a><br> Table header content to be repeated on each new page</dd>
|
||||||
<dt><b>$theadMargin</b></dt>
|
<dt><b>$theadMargins</b></dt>
|
||||||
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$theadMargin">TCPDF::$theadMargin</a><br> Distance between the top of page and end of table headers on a new page.</dd>
|
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$theadMargins">TCPDF::$theadMargins</a><br> Margins used for table header.</dd>
|
||||||
<dt><b>$title</b></dt>
|
<dt><b>$title</b></dt>
|
||||||
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$title">TCPDF::$title</a></dd>
|
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$title">TCPDF::$title</a></dd>
|
||||||
<dt><b>$tMargin</b></dt>
|
<dt><b>$tMargin</b></dt>
|
||||||
@ -1387,7 +1387,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, 28 May 2009 19:14:09 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
Documentation generated on Thu, 04 Jun 2009 14:29:38 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</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 Thu, 28 May 2009 19:14:15 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
Documentation generated on Thu, 04 Jun 2009 14:29:45 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
||||||
</div>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -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, 28 May 2009 19:14:09 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
Documentation generated on Thu, 04 Jun 2009 14:29:39 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
||||||
</div>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -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, 28 May 2009 19:14:09 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
Documentation generated on Thu, 04 Jun 2009 14:29:39 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
|
||||||
</div>
|
</div>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
67
tcpdf.php
67
tcpdf.php
@ -2,9 +2,9 @@
|
|||||||
//============================================================+
|
//============================================================+
|
||||||
// File name : tcpdf.php
|
// File name : tcpdf.php
|
||||||
// Begin : 2002-08-03
|
// Begin : 2002-08-03
|
||||||
// Last Update : 2009-05-28
|
// Last Update : 2009-06-04
|
||||||
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
|
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
|
||||||
// Version : 4.6.013
|
// Version : 4.6.014
|
||||||
// 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.013
|
* @version 4.6.014
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -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.013 (http://www.tcpdf.org)');
|
define('PDF_PRODUCER', 'TCPDF 4.6.014 (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.013
|
* @version 4.6.014
|
||||||
* @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
|
||||||
@ -1239,11 +1239,11 @@ if (!class_exists('TCPDF', false)) {
|
|||||||
protected $thead = '';
|
protected $thead = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Distance between the top of page and end of table headers on a new page.
|
* Margins used for table header.
|
||||||
* @access protected
|
* @access protected
|
||||||
* @since 4.5.030 (2009-03-20)
|
* @since 4.5.030 (2009-03-20)
|
||||||
*/
|
*/
|
||||||
protected $theadMargin = '';
|
protected $theadMargins = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cache array for UTF8StringToArray() method.
|
* Cache array for UTF8StringToArray() method.
|
||||||
@ -2485,21 +2485,26 @@ if (!class_exists('TCPDF', false)) {
|
|||||||
* @since 4.5.030 (2009-03-25)
|
* @since 4.5.030 (2009-03-25)
|
||||||
*/
|
*/
|
||||||
protected function setTableHeader() {
|
protected function setTableHeader() {
|
||||||
if (!$this->empty_string($this->theadMargin)) {
|
if (isset($this->theadMargins['top'])) {
|
||||||
// restore the original top-margin
|
// restore the original top-margin
|
||||||
$this->tMargin = $this->theadMargin;
|
$this->tMargin = $this->theadMargins['top'];
|
||||||
$this->pagedim[$this->page]['tm'] = $this->theadMargin;
|
$this->pagedim[$this->page]['tm'] = $this->tMargin;
|
||||||
$this->y = $this->theadMargin;
|
$this->y = $this->tMargin;
|
||||||
}
|
}
|
||||||
if (!$this->empty_string($this->thead)) {
|
if (!$this->empty_string($this->thead)) {
|
||||||
|
// set margins
|
||||||
|
$this->lMargin = $this->pagedim[$this->page]['olm'];
|
||||||
|
$this->rMargin = $this->pagedim[$this->page]['orm'];
|
||||||
|
$this->cMargin = $this->theadMargins['cmargin'];
|
||||||
// print table header
|
// print table header
|
||||||
$this->writeHTML($this->thead, false, false, false, false, '');
|
$this->writeHTML($this->thead, false, false, false, false, '');
|
||||||
// set new top margin to skip the table headers
|
// set new top margin to skip the table headers
|
||||||
if (!isset($this->theadMargin) OR ($this->empty_string($this->theadMargin))) {
|
if (!isset($this->theadMargins['top'])) {
|
||||||
$this->theadMargin = $this->tMargin;
|
$this->theadMargins['top'] = $this->tMargin;
|
||||||
}
|
}
|
||||||
$this->tMargin = $this->y;
|
$this->tMargin = $this->y;
|
||||||
$this->pagedim[$this->page]['tm'] = $this->tMargin;
|
$this->pagedim[$this->page]['tm'] = $this->tMargin;
|
||||||
|
$this->lasth = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3964,7 +3969,7 @@ if (!class_exists('TCPDF', false)) {
|
|||||||
}
|
}
|
||||||
// max column width
|
// max column width
|
||||||
$wmax = $w - (2 * $this->cMargin);
|
$wmax = $w - (2 * $this->cMargin);
|
||||||
if ($chrwidth > $wmax) {
|
if (($chrwidth > $wmax) OR ($this->GetCharWidth($chars[0]) > $wmax)) {
|
||||||
// a single character do not fit on column
|
// a single character do not fit on column
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@ -10828,16 +10833,23 @@ if (!class_exists('TCPDF', false)) {
|
|||||||
*/
|
*/
|
||||||
protected function getHtmlDomArray($html) {
|
protected function getHtmlDomArray($html) {
|
||||||
// remove all unsupported tags (the line below lists all supported tags)
|
// remove all unsupported tags (the line below lists all supported tags)
|
||||||
$html = strip_tags($html, '<marker/><a><b><blockquote><br><br/><dd><del><div><dl><dt><em><font><h1><h2><h3><h4><h5><h6><hr><i><img><li><ol><p><pre><small><span><strong><sub><sup><table><tcpdf><td><th><thead><tr><tt><u><ul>');
|
$html = strip_tags($html, '<marker/><a><b><blockquote><br><br/><dd><del><div><dl><dt><em><font><h1><h2><h3><h4><h5><h6><hr><i><img><li><ol><p><pre><small><span><strong><sub><sup><table><tablehead><tcpdf><td><th><thead><tr><tt><u><ul>');
|
||||||
//replace some blank characters
|
//replace some blank characters
|
||||||
$html = preg_replace('/<pre/', '<xre', $html); // preserve pre tag
|
$html = preg_replace('/<pre/', '<xre', $html); // preserve pre tag
|
||||||
$html = preg_replace('/<(table|tr|td|th|tcpdf|blockquote|dd|div|dt|h1|h2|h3|h4|h5|h6|br|hr|li|ol|ul|p)([^\>]*)>[\n\r\t]+/', '<\\1\\2>', $html);
|
$html = preg_replace('/<(table|tr|td|th|tcpdf|blockquote|dd|div|dt|h1|h2|h3|h4|h5|h6|br|hr|li|ol|ul|p)([^\>]*)>[\n\r\t]+/', '<\\1\\2>', $html);
|
||||||
$html = preg_replace('@(\r\n|\r)@', "\n", $html);
|
$html = preg_replace('@(\r\n|\r)@', "\n", $html);
|
||||||
$repTable = array("\t" => ' ', "\0" => ' ', "\x0B" => ' ', "\\" => "\\\\");
|
$repTable = array("\t" => ' ', "\0" => ' ', "\x0B" => ' ', "\\" => "\\\\");
|
||||||
$html = strtr($html, $repTable);
|
$html = strtr($html, $repTable);
|
||||||
while (preg_match("'<xre([^\>]*)>(.*?)\n(.*?)</pre>'si", $html)) {
|
$offset = 0;
|
||||||
|
while (($offset < strlen($html)) AND ($pos = strpos($html, '</pre>', $offset)) !== false) {
|
||||||
|
$html_a = substr($html, 0, $offset);
|
||||||
|
$html_b = substr($html, $offset, ($pos - $offset + 6));
|
||||||
|
while (preg_match("'<xre([^\>]*)>(.*?)\n(.*?)</pre>'si", $html_b)) {
|
||||||
// preserve newlines on <pre> tag
|
// preserve newlines on <pre> tag
|
||||||
$html = preg_replace("'<xre([^\>]*)>(.*?)\n(.*?)</pre>'si", "<xre\\1>\\2<br />\\3</pre>", $html);
|
$html_b = preg_replace("'<xre([^\>]*)>(.*?)\n(.*?)</pre>'si", "<xre\\1>\\2<br />\\3</pre>", $html_b);
|
||||||
|
}
|
||||||
|
$html = $html_a.$html_b.substr($html, $pos + 6);
|
||||||
|
$offset = strlen($html_a.$html_b);
|
||||||
}
|
}
|
||||||
$html = str_replace("\n", ' ', $html);
|
$html = str_replace("\n", ' ', $html);
|
||||||
// remove extra spaces from code
|
// remove extra spaces from code
|
||||||
@ -10935,7 +10947,7 @@ if (!class_exists('TCPDF', false)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (($dom[$key]['value'] == 'table') AND (!$this->empty_string($dom[($dom[$key]['parent'])]['thead']))) {
|
if (($dom[$key]['value'] == 'table') AND (!$this->empty_string($dom[($dom[$key]['parent'])]['thead']))) {
|
||||||
$dom[($dom[$key]['parent'])]['thead'] .= '</table>';
|
$dom[($dom[$key]['parent'])]['thead'] .= '</tablehead>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// opening html tag
|
// opening html tag
|
||||||
@ -12063,6 +12075,10 @@ if (!class_exists('TCPDF', false)) {
|
|||||||
if (!$this->empty_string($dom[$key]['thead'])) {
|
if (!$this->empty_string($dom[$key]['thead'])) {
|
||||||
// set table header
|
// set table header
|
||||||
$this->thead = $dom[$key]['thead'];
|
$this->thead = $dom[$key]['thead'];
|
||||||
|
if (!isset($this->theadMargins) OR (empty($this->theadMargins))) {
|
||||||
|
$this->theadMargins = array();
|
||||||
|
$this->theadMargins['cmargin'] = $this->cMargin;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (isset($tag['attribute']['cellpadding'])) {
|
if (isset($tag['attribute']['cellpadding'])) {
|
||||||
$cp = $this->getHTMLUnitToUnits($tag['attribute']['cellpadding'], 1, 'px');
|
$cp = $this->getHTMLUnitToUnits($tag['attribute']['cellpadding'], 1, 'px');
|
||||||
@ -12374,6 +12390,7 @@ if (!class_exists('TCPDF', false)) {
|
|||||||
$tag = $dom[$key];
|
$tag = $dom[$key];
|
||||||
$parent = $dom[($dom[$key]['parent'])];
|
$parent = $dom[($dom[$key]['parent'])];
|
||||||
$firstorlast = ((!isset($dom[($key + 1)])) OR ((!isset($dom[($key + 2)])) AND ($dom[($key + 1)]['value'] == 'marker')));
|
$firstorlast = ((!isset($dom[($key + 1)])) OR ((!isset($dom[($key + 2)])) AND ($dom[($key + 1)]['value'] == 'marker')));
|
||||||
|
$in_table_head = false;
|
||||||
//Closing tag
|
//Closing tag
|
||||||
switch($tag['value']) {
|
switch($tag['value']) {
|
||||||
case 'tr': {
|
case 'tr': {
|
||||||
@ -12434,6 +12451,9 @@ if (!class_exists('TCPDF', false)) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'tablehead':
|
||||||
|
// closing tag used for the thead part
|
||||||
|
$in_table_head = true;
|
||||||
case 'table': {
|
case 'table': {
|
||||||
// draw borders
|
// draw borders
|
||||||
$table_el = $parent;
|
$table_el = $parent;
|
||||||
@ -12576,18 +12596,21 @@ if (!class_exists('TCPDF', false)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!$in_table_head) {
|
||||||
|
// we are not inside a thead section
|
||||||
if (isset($parent['cellpadding'])) {
|
if (isset($parent['cellpadding'])) {
|
||||||
$this->cMargin = $this->oldcMargin;
|
$this->cMargin = $this->oldcMargin;
|
||||||
}
|
}
|
||||||
$this->lasth = $this->FontSize * $this->cell_height_ratio;
|
$this->lasth = $this->FontSize * $this->cell_height_ratio;
|
||||||
if (!$this->empty_string($this->theadMargin)) {
|
if (!empty($this->theadMargins)) {
|
||||||
// restore top margin
|
// restore top margin
|
||||||
$this->tMargin = $this->theadMargin;
|
$this->tMargin = $this->theadMargins['top'];
|
||||||
$this->pagedim[$this->page]['tm'] = $this->theadMargin;
|
$this->pagedim[$this->page]['tm'] = $this->tMargin;
|
||||||
}
|
}
|
||||||
// reset table header
|
// reset table header
|
||||||
$this->thead = '';
|
$this->thead = '';
|
||||||
$this->theadMargin = '';
|
$this->theadMargins = array();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'a': {
|
case 'a': {
|
||||||
|
Loading…
Reference in New Issue
Block a user