32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-22 12:55:10 +00:00
This commit is contained in:
nicolaasuni 2010-11-16 19:26:45 +01:00
parent 3e107fc8ef
commit c02e3115e2
23 changed files with 555 additions and 416 deletions

View File

@ -1,3 +1,7 @@
5.9.017 (2010-11-16)
- Tagline color was set to transparent.
- The method fixHTMLCode() was added to automatically clean up HTML code (requires HTML Tidy).
5.9.016 (2010-11-16)
- Bug item #3109705 "list item page break hanging bullet" was fixed.

View File

@ -8,7 +8,7 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 5.9.016
Version: 5.9.017
Release date: 2010-11-16
Author: Nicola Asuni

View File

@ -65,7 +65,7 @@
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:22 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:35 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1004,7 +1004,7 @@ $code)</code>
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:23 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:35 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -5552,7 +5552,7 @@ $frame)</code>
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:23 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:36 +0100 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

@ -300,7 +300,7 @@ $type)</code>
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:22 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:35 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1378,7 +1378,7 @@ $type)</code>
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:22 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:35 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -18704,7 +18704,7 @@ This is a PHP class containing Unicde data for TCPDF library<br /><br /><br /><b
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:29 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:42 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -106,7 +106,7 @@ PHP class to creates array representations for 2D barcodes to be used with TCPDF
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:22 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:35 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -106,7 +106,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:22 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:35 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -543,7 +543,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:29 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:42 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -98,7 +98,7 @@ Array of WEB safe colors<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:23 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:35 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -158,7 +158,7 @@ Class to create PDF417 barcode arrays for TCPDF class.<br /><br /><p>PDF417 (ISO
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:23 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:35 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -481,7 +481,7 @@ string $string, [int $split_length = 1])</code>
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:23 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:36 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -83,7 +83,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>5.9.016</td>
<td><b>version:</b>&nbsp;&nbsp;</td><td>5.9.017</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 @@ main configuration file<br /><br /><p>(define the K_TCPDF_EXTERNAL_CONFIG consta
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:24 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:37 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -103,7 +103,7 @@ Unicode data class for TCPDF library.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:29 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:42 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -539,6 +539,8 @@
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$fwPt">TCPDF::$fwPt</a></dd>
<dt><b>fitBlock</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodfitBlock">TCPDF::fitBlock()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the block dimensions accounting for page breaks and page/column fitting</dd>
<dt><b>fixHTMLCode</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodfixHTMLCode">TCPDF::fixHTMLCode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Cleanup HTML code (requires HTML Tidy library).</dd>
<dt><b>Footer</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodFooter">TCPDF::Footer()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;This method is used to render the page footer.</dd>
<dt><b>formatPageNumber</b></dt>
@ -2138,7 +2140,7 @@
<a href="elementindex.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:22 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:35 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -746,6 +746,8 @@
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$fwPt">TCPDF::$fwPt</a></dd>
<dt><b>fitBlock</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodfitBlock">TCPDF::fitBlock()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the block dimensions accounting for page breaks and page/column fitting</dd>
<dt><b>fixHTMLCode</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodfixHTMLCode">TCPDF::fixHTMLCode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Cleanup HTML code (requires HTML Tidy library).</dd>
<dt><b>Footer</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodFooter">TCPDF::Footer()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;This method is used to render the page footer.</dd>
<dt><b>formatPageNumber</b></dt>
@ -2171,7 +2173,7 @@
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Tue, 16 Nov 2010 17:59:22 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:35 +0100 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 Tue, 16 Nov 2010 17:59:29 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:42 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -68,7 +68,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 Tue, 16 Nov 2010 17:59:22 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:35 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -68,7 +68,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 Tue, 16 Nov 2010 17:59:22 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Tue, 16 Nov 2010 19:26:35 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1,7 +1,7 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 5.9.016
// Version : 5.9.017
// Begin : 2002-08-03
// Last Update : 2010-11-16
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
@ -134,7 +134,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 5.9.016
* @version 5.9.017
*/
/**
@ -148,7 +148,7 @@ require_once(dirname(__FILE__).'/config/tcpdf_config.php');
* 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 5.9.016
* @version 5.9.017
* @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
@ -161,7 +161,7 @@ class TCPDF {
* @var current TCPDF version
* @access private
*/
private $tcpdf_version = '5.9.016';
private $tcpdf_version = '5.9.017';
// Protected properties
@ -3631,8 +3631,7 @@ class TCPDF {
$this->lMargin = 0;
$this->_out('q');
$this->SetFont('helvetica', '', 1);
$this->AddSpotColor('trnsprnt', 0, 0, 0, 50);
$this->SetTextSpotColor('trnsprnt', 0);
$this->setTextRenderingMode(0, false, false);
$msg = "\x50\x6f\x77\x65\x72\x65\x64\x20\x62\x79\x20\x54\x43\x50\x44\x46\x20\x28\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67\x29";
$lnk = "\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67";
$this->Cell(0, 0, $msg, 0, 0, 'L', 0, $lnk, 0, false, 'D', 'B');
@ -17426,6 +17425,71 @@ class TCPDF {
return $this->FontStyle;
}
/**
* Cleanup HTML code (requires HTML Tidy library).
* @param string $html htmlcode to fix
* @param string $default_css CSS commands to add
* @param array $tagvs parameters for setHtmlVSpace method
* @param array $tidy_options options for tidy_parse_string function
* @return string XHTML code cleaned up
* @author Nicola Asuni
* @access public
* @since 5.9.017 (2010-11-16)
* @see setHtmlVSpace()
*/
public function fixHTMLCode($html, $default_css='', $tagvs='', $tidy_options='') {
// configure parameters for HTML Tidy
if ($tidy_options === '') {
$tidy_options = array (
'clean' => 1,
'drop-empty-paras' => 0,
'drop-proprietary-attributes' => 1,
'fix-backslash' => 1,
'hide-comments' => 1,
'join-styles' => 1,
'lower-literals' => 1,
'merge-divs' => 1,
'merge-spans' => 1,
'output-xhtml' => 1,
'word-2000' => 1,
'wrap' => 0,
'output-bom' => 0,
//'char-encoding' => 'utf8',
//'input-encoding' => 'utf8',
//'output-encoding' => 'utf8'
);
}
// clean up the HTML code
$tidy = tidy_parse_string($html, $tidy_options);
// fix the HTML
$tidy->cleanRepair();
// get the CSS part
$tidy_head = tidy_get_head($tidy);
$css = $tidy_head->value;
$css = preg_replace('/<style([^>]+)>/ims', '<style>', $css);
$css = preg_replace('/<\/style>(.*)<style>/ims', "\n", $css);
$css = str_replace('/*<![CDATA[*/', '', $css);
$css = str_replace('/*]]>*/', '', $css);
preg_match('/<style>(.*)<\/style>/ims', $css, $matches);
$css = strtolower($matches[1]);
// include default css
$css = '<style>'.$default_css.$css.'</style>';
// get the body part
$tidy_body = tidy_get_body($tidy);
$html = $tidy_body->value;
// fix some self-closing tags
$html = str_replace('<br>', '<br />', $html);
// remove some empty tag blocks
$html = preg_replace('/<div([^\>]*)><\/div>/', '', $html);
$html = preg_replace('/<p([^\>]*)><\/p>/', '', $html);
if ($tagvs !== '') {
// set vertical space for some XHTML tags
$this->setHtmlVSpace($tagvs);
}
// return the cleaned XHTML code + CSS
return $css.$html;
}
/**
* Extracts the CSS properties from a CSS string.
* @param string $cssdata string containing CSS definitions.
@ -19166,7 +19230,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$fontsize = isset($dom[$key]['fontsize']) ? $dom[$key]['fontsize'] : $curfontsize;
$fontascent = $this->getFontAscent($fontname, $fontstyle, $fontsize);
$fontdescent = $this->getFontDescent($fontname, $fontstyle, $fontsize);
if ( ($fontname != $curfontname) OR ($fontstyle != $curfontstyle) OR ($fontsize != $curfontsize)
if ( ($fontname != $curfontname) OR ($fontstyle != $curfontstyle) OR ($fontsize != $curfontsize)
OR ($this->cell_height_ratio != $dom[$key]['line-height'])
OR ($dom[$key]['tag'] AND $dom[$key]['opening'] AND ($dom[$key]['value'] == 'li')) ) {
if ((!$this->newline) AND ($key < ($maxel - 1))