30
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-05-31 21:30:47 +00:00
This commit is contained in:
nicolaasuni 2011-02-16 15:24:20 +01:00
parent e5aa76fdbe
commit f89223a6da
3 changed files with 41 additions and 7 deletions

View File

@ -1,3 +1,6 @@
5.9.053 (2011-02-16)
- Support for HTMl attribute display="none" was added.
5.9.052 (2011-02-15)
- A bug related to HTML automatic newlines was fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 5.9.052
Release date: 2011-02-15
Version: 5.9.053
Release date: 2011-02-16
Author: Nicola Asuni
Copyright (c) 2002-2011:

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 5.9.052
// Version : 5.9.053
// Begin : 2002-08-03
// Last Update : 2011-02-15
// Last Update : 2011-02-16
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
// License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3 + YOU CAN'T REMOVE ANY TCPDF COPYRIGHT NOTICE OR LINK FROM THE GENERATED PDF DOCUMENTS.
// -------------------------------------------------------------------
@ -134,7 +134,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 5.9.052
* @version 5.9.053
*/
// Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file.
@ -146,7 +146,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>
* @package com.tecnick.tcpdf
* @brief PHP class for generating PDF documents without requiring external extensions.
* @version 5.9.052
* @version 5.9.053
* @author Nicola Asuni - info@tecnick.com
*/
class TCPDF {
@ -157,7 +157,7 @@ class TCPDF {
* Current TCPDF version.
* @private
*/
private $tcpdf_version = '5.9.052';
private $tcpdf_version = '5.9.053';
// Protected properties
@ -18425,6 +18425,7 @@ class TCPDF {
$dom[$key]['block'] = false;
$dom[$key]['value'] = '';
$dom[$key]['parent'] = 0;
$dom[$key]['hide'] = false;
$dom[$key]['fontname'] = $this->FontFamily;
$dom[$key]['fontstyle'] = $this->FontStyle;
$dom[$key]['fontsize'] = $this->FontSizePt;
@ -18478,6 +18479,7 @@ class TCPDF {
$dom[$key]['opening'] = false;
$dom[$key]['parent'] = end($level);
array_pop($level);
$dom[$key]['hide'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['hide'];
$dom[$key]['fontname'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['fontname'];
$dom[$key]['fontstyle'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['fontstyle'];
$dom[$key]['fontsize'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['fontsize'];
@ -18546,6 +18548,7 @@ class TCPDF {
$parentkey = 0;
if ($key > 0) {
$parentkey = $dom[$key]['parent'];
$dom[$key]['hide'] = $dom[$parentkey]['hide'];
$dom[$key]['fontname'] = $dom[$parentkey]['fontname'];
$dom[$key]['fontstyle'] = $dom[$parentkey]['fontstyle'];
$dom[$key]['fontsize'] = $dom[$parentkey]['fontsize'];
@ -18588,6 +18591,10 @@ class TCPDF {
if (isset($dom[$key]['style']['direction'])) {
$dom[$key]['dir'] = $dom[$key]['style']['direction'];
}
// display
if (isset($dom[$key]['style']['display'])) {
$dom[$key]['hide'] = (trim(strtolower($dom[$key]['style']['display'])) == 'none');
}
// font family
if (isset($dom[$key]['style']['font-family'])) {
$dom[$key]['fontname'] = $this->getFontFamilyName($dom[$key]['style']['font-family']);
@ -18876,6 +18883,9 @@ class TCPDF {
}
}
}
if (isset($dom[$key]['attribute']['display'])) {
$dom[$key]['hide'] = (trim(strtolower($dom[$key]['attribute']['display'])) == 'none');
}
if (isset($dom[$key]['attribute']['border']) AND ($dom[$key]['attribute']['border'] != 0)) {
$borderstyle = $this->getCSSBorderStyle($dom[$key]['attribute']['border'].' solid black');
if (!empty($borderstyle)) {
@ -19181,7 +19191,28 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$dom = $this->getHtmlDomArray($html);
$maxel = count($dom);
$key = 0;
$hidden_node_key = -1;
while ($key < $maxel) {
if ($dom[$key]['tag']) {
if ($dom[$key]['opening']) {
if (($hidden_node_key <= 0) AND $dom[$key]['hide']) {
// store the node key
$hidden_node_key = $key;
}
} elseif (($hidden_node_key > 0) AND ($dom[$key]['parent'] == $hidden_node_key)) {
// we have reached the closing tag of the hidden node
$hidden_node_key = 0;
}
}
if ($hidden_node_key >= 0) {
// skip this node
++$key;
if ($hidden_node_key == 0) {
// reset hidden mode
$hidden_node_key = -1;
}
continue;
}
if ($dom[$key]['tag'] AND isset($dom[$key]['attribute']['pagebreak'])) {
// check for pagebreak
if (($dom[$key]['attribute']['pagebreak'] == 'true') OR ($dom[$key]['attribute']['pagebreak'] == 'left') OR ($dom[$key]['attribute']['pagebreak'] == 'right')) {