0001: diff -Naurp html2pdf_v4.03.orig/_class/myPdf.class.php html2pdf_v4.03.new/_class/myPdf.class.php
0002: --- html2pdf_v4.03.orig/_class/myPdf.class.php 2011-05-26 18:01:10.000000000 +0200
0003: +++ html2pdf_v4.03.new/_class/myPdf.class.php 2013-06-05 12:26:37.292763024 +0200
0004: @@ -10,7 +10,22 @@
0005: */
0006:
0007: require_once(dirname(__FILE__).'/tcpdfConfig.php');
0008: -require_once(dirname(__FILE__).'/../_tcpdf_'.HTML2PDF_USED_TCPDF_VERSION.'/tcpdf.php');
0009: +if (!defined('K_PATH_MAIN')) {
0010: + require_once(dirname(__FILE__).'/../tcpdf/tcpdf.php');
0011: +} else if (!(K_PATH_MAIN)) {
0012: + require_once(dirname(__FILE__).'/../tcpdf/tcpdf.php');
0013: +} else {
0014: + require_once(K_PATH_MAIN . '/tcpdf.php');
0015: +}
0016: +
0017: +if (!defined('HTML2PDF_USED_TCPDF_VERSION')) {
0018: + if (defined('PDF_PRODUCER')) {
0019: + define('HTML2PDF_USED_TCPDF_VERSION', preg_replace('/^.*? (\d[0-9.]*).*$/', '\1', PDF_PRODUCER));
0020: + } else {
0021: + require_once(K_PATH_MAIN . 'include/tcpdf_static.php');
0022: + define('HTML2PDF_USED_TCPDF_VERSION', TCPDF_STATIC::getTCPDFVersion());
0023: + }
0024: +}
0025:
0026: class HTML2PDF_myPdf extends TCPDF
0027: {
0028: @@ -47,6 +62,11 @@ class HTML2PDF_myPdf extends TCPDF
0029: // call the parent constructor
0030: parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache);
0031:
0032: + // Avoid TCPDF site link output.
0033: + if (property_exists($this, 'tcpdflink')) {
0034: + $this->tcpdflink = false;
0035: + }
0036: +
0037: // init the specific parameters used by HTML2PDF
0038: $this->SetCreator(PDF_CREATOR);
0039: $this->SetAutoPageBreak(false, 0);
0040: @@ -1295,10 +1315,14 @@ class HTML2PDF_myPdf extends TCPDF
0041: $strsize=$this->GetStringWidth($str);
0042: }
0043:
0044: + //Insert a link.
0045: + $link = $this->AddLink();
0046: + $this->SetLink($link, $this->outlines[$i]['y'], $this->outlines[$i]['p']);
0047: +
0048: // if we want to display the page nmber
0049: if ($displayPage) {
0050: // display the Bookmark Caption
0051: - $this->Cell($strsize+2, $this->FontSize+2, $str);
0052: + $this->Cell($strsize+2, $this->FontSize+2, $str, 0, 0, '', false, $link);
0053:
0054: //Filling dots
0055: $w=$this->w-$this->lMargin-$this->rMargin-$pageCellSize-($level*8)-($strsize+2);
0056: @@ -1307,10 +1331,10 @@ class HTML2PDF_myPdf extends TCPDF
0057: $this->Cell($w, $this->FontSize+2, $dots, 0, 0, 'R');
0058:
0059: //Page number
0060: - $this->Cell($pageCellSize, $this->FontSize+2, 'p. '.$this->outlines[$i]['p'], 0, 1, 'R');
0061: + $this->Cell($pageCellSize, $this->FontSize+2, 'p. '.$this->outlines[$i]['p'], 0, 1, 'R', false, $link);
0062: } else {
0063: // display the Bookmark Caption
0064: - $this->Cell($strsize+2, $this->FontSize+2, $str, 0, 1);
0065: + $this->Cell($strsize+2, $this->FontSize+2, $str, 0, 1, '', false, $link);
0066: }
0067: }
0068: }
0069: diff -Naurp html2pdf_v4.03.orig/_class/parsingCss.class.php html2pdf_v4.03.new/_class/parsingCss.class.php
0070: --- html2pdf_v4.03.orig/_class/parsingCss.class.php 2011-05-26 18:01:10.000000000 +0200
0071: +++ html2pdf_v4.03.new/_class/parsingCss.class.php 2013-05-30 17:42:35.379699132 +0200
0072: @@ -94,8 +94,13 @@ class HTML2PDF_parsingCss
0073: protected function _init()
0074: {
0075: // get the Web Colors from TCPDF
0076: - require(K_PATH_MAIN.'htmlcolors.php');
0077: - $this->_htmlColor = $webcolor;
0078: + if ((int) substr(HTML2PDF_USED_TCPDF_VERSION, 0, 1) >= 6) {
0079: + require_once(K_PATH_MAIN . 'include/tcpdf_colors.php');
0080: + $this->_htmlColor = TCPDF_COLORS::$webcolor;
0081: + } else {
0082: + require(K_PATH_MAIN.'htmlcolors.php');
0083: + $this->_htmlColor = $webcolor;
0084: + }
0085:
0086: // init the Style
0087: $this->table = array();
0088: @@ -1809,4 +1814,4 @@ class HTML2PDF_parsingCss
0089: //analyse the css content
0090: $this->_analyseStyle($style);
0091: }
0092: -}
0093: \ No newline at end of file
0094: +}
0095: diff -Naurp html2pdf_v4.03.orig/_class/tcpdfConfig.php html2pdf_v4.03.new/_class/tcpdfConfig.php
0096: --- html2pdf_v4.03.orig/_class/tcpdfConfig.php 2011-04-29 13:37:33.000000000 +0200
0097: +++ html2pdf_v4.03.new/_class/tcpdfConfig.php 2013-05-30 16:34:08.267025933 +0200
0098: @@ -2,31 +2,39 @@
0099: //============================================================+
0100: // File name : tcpdf_config.php
0101: // Begin : 2004-06-11
0102: -// Last Update : 2009-09-30
0103: +// Last Update : 2013-05-16
0104: //
0105: // Description : Configuration file for TCPDF.
0106: +// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
0107: +// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
0108: +// -------------------------------------------------------------------
0109: +// Copyright (C) 2004-2013 Nicola Asuni - Tecnick.com LTD
0110: //
0111: -// Author: Nicola Asuni
0112: +// Extracted from version 6.0.017 and adapted for html2pdf.
0113: //
0114: -// (c) Copyright:
0115: -// Nicola Asuni
0116: -// Tecnick.com s.r.l.
0117: -// Via Della Pace, 11
0118: -// 09044 Quartucciu (CA)
0119: -// ITALY
0120: -// www.tecnick.com
0121: -// info@tecnick.com
0122: +// This file is part of TCPDF software library.
0123: +//
0124: +// TCPDF is free software: you can redistribute it and/or modify it
0125: +// under the terms of the GNU Lesser General Public License as
0126: +// published by the Free Software Foundation, either version 3 of the
0127: +// License, or (at your option) any later version.
0128: +//
0129: +// TCPDF is distributed in the hope that it will be useful, but
0130: +// WITHOUT ANY WARRANTY; without even the implied warranty of
0131: +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0132: +// See the GNU Lesser General Public License for more details.
0133: +//
0134: +// You should have received a copy of the GNU Lesser General Public License
0135: +// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
0136: +//
0137: +// See LICENSE.TXT file for more information.
0138: //============================================================+
0139:
0140: /**
0141: * Configuration file for TCPDF.
0142: * @author Nicola Asuni
0143: - * @copyright 2004-2008 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com)
0144: - * Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
0145: * @package com.tecnick.tcpdf
0146: - * @version 4.0.014
0147: - * @link http://tcpdf.sourceforge.net
0148: - * @license http://www.gnu.org/copyleft/lesser.html LGPL
0149: + * @version 4.9.005
0150: * @since 2004-10-27
0151: */
0152:
0153: @@ -36,210 +44,181 @@ if (!defined('K_TCPDF_EXTERNAL_CONFIG'))
0154:
0155: define('K_TCPDF_EXTERNAL_CONFIG', true);
0156:
0157: - // DOCUMENT_ROOT fix for IIS Webserver
0158: - if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) {
0159: - if (isset($_SERVER['SCRIPT_FILENAME'])) {
0160: - $_SERVER['DOCUMENT_ROOT'] = str_replace(
0161: - '\\',
0162: - '/',
0163: - substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF']))
0164: - );
0165: - } elseif (isset($_SERVER['PATH_TRANSLATED'])) {
0166: - $_SERVER['DOCUMENT_ROOT'] = str_replace(
0167: - '\\',
0168: - '/',
0169: - substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF']))
0170: - );
0171: - } else {
0172: - // define here your DOCUMENT_ROOT path if the previous fails
0173: - $_SERVER['DOCUMENT_ROOT'] = '/var/www';
0174: - }
0175: - }
0176: -
0177: - // Automatic calculation for the following K_PATH_MAIN constant
0178: - $kPathMain = str_replace('\\', '/', dirname(__FILE__));
0179: - $kPathMain = dirname($kPathMain).'/'; // remove the current directory
0180: - $kPathMain.= '_tcpdf_'.HTML2PDF_USED_TCPDF_VERSION.'/';
0181: - define('K_PATH_MAIN', $kPathMain);
0182: -
0183: - // Automatic calculation for the following K_PATH_URL constant
0184: - if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) {
0185: - if (isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS'])!='off') {
0186: - $kPathUrl = 'https://';
0187: - } else {
0188: - $kPathUrl = 'http://';
0189: - }
0190: - $kPathUrl .= $_SERVER['HTTP_HOST'];
0191: - $kPathUrl .= str_replace('\\', '/', substr(K_PATH_MAIN, (strlen($_SERVER['DOCUMENT_ROOT']) - 1)));
0192: - }
0193: -
0194: /**
0195: - * URL path to tcpdf installation folder (http://localhost/tcpdf/).
0196: + * Installation path (/var/www/tcpdf/).
0197: * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
0198: */
0199: - define('K_PATH_URL', $kPathUrl);
0200: -
0201: + //define ('K_PATH_MAIN', '');
0202: +
0203: /**
0204: - * path for PDF fonts
0205: - * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts
0206: + * URL path to tcpdf installation folder (http://localhost/tcpdf/).
0207: + * By default it is automatically set but you can also set it as a fixed string to improve performances.
0208: */
0209: - define('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
0210: -
0211: + //define ('K_PATH_URL', '');
0212: +
0213: /**
0214: - * cache directory for temporary files (full path)
0215: + * Path for PDF fonts.
0216: + * By default it is automatically set but you can also set it as a fixed string to improve performances.
0217: */
0218: - define('K_PATH_CACHE', K_PATH_MAIN.'cache/');
0219: -
0220: + //define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
0221: +
0222: /**
0223: - * cache directory for temporary files (url path)
0224: + * Default images directory.
0225: + * By default it is automatically set but you can also set it as a fixed string to improve performances.
0226: */
0227: - define('K_PATH_URL_CACHE', K_PATH_URL.'cache/');
0228: -
0229: + //define ('K_PATH_IMAGES', '');
0230: +
0231: /**
0232: - *images directory
0233: + * Deafult image logo used be the default Header() method.
0234: + * Please set here your own logo or an empty string to disable it.
0235: */
0236: - define('K_PATH_IMAGES', K_PATH_MAIN.'images/');
0237: -
0238: + define ('PDF_HEADER_LOGO', '');
0239: +
0240: /**
0241: - * blank image
0242: + * Header logo image width in user units.
0243: */
0244: - define('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png');
0245: -
0246: + define ('PDF_HEADER_LOGO_WIDTH', 0);
0247: +
0248: /**
0249: - * page format
0250: + * Cache directory for temporary files (full path).
0251: */
0252: - define('PDF_PAGE_FORMAT', 'A4');
0253: -
0254: + define ('K_PATH_CACHE', sys_get_temp_dir().'/');
0255: +
0256: /**
0257: - * page orientation (P=portrait, L=landscape)
0258: + * Generic name for a blank image.
0259: */
0260: - define('PDF_PAGE_ORIENTATION', 'P');
0261: -
0262: + define ('K_BLANK_IMAGE', '_blank.png');
0263: +
0264: /**
0265: - * document creator
0266: + * Page format.
0267: */
0268: - define('PDF_CREATOR', 'HTML2PDF - TCPDF');
0269: -
0270: + define ('PDF_PAGE_FORMAT', 'A4');
0271: +
0272: /**
0273: - * document author
0274: + * Page orientation (P=portrait, L=landscape).
0275: */
0276: - define('PDF_AUTHOR', 'HTML2PDF - TCPDF');
0277: -
0278: + define ('PDF_PAGE_ORIENTATION', 'P');
0279: +
0280: /**
0281: - * header title
0282: + * Document creator.
0283: */
0284: - define('PDF_HEADER_TITLE', null);
0285: -
0286: + define ('PDF_CREATOR', 'HTML2PDF - TCPDF');
0287: +
0288: /**
0289: - * header description string
0290: + * Document author.
0291: */
0292: - define('PDF_HEADER_STRING', null);
0293: -
0294: + define ('PDF_AUTHOR', 'HTML2PDF - TCPDF');
0295: +
0296: /**
0297: - * image logo
0298: + * Header title.
0299: */
0300: - define('PDF_HEADER_LOGO', null);
0301: -
0302: + define ('PDF_HEADER_TITLE', '');
0303: +
0304: /**
0305: - * header logo image width [mm]
0306: + * Header description string.
0307: */
0308: - define('PDF_HEADER_LOGO_WIDTH', null);
0309: -
0310: + define ('PDF_HEADER_STRING', '');
0311: +
0312: /**
0313: - * document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]
0314: + * Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
0315: */
0316: - define('PDF_UNIT', 'mm');
0317: -
0318: + define ('PDF_UNIT', 'mm');
0319: +
0320: /**
0321: - * header margin
0322: + * Header margin.
0323: */
0324: - define('PDF_MARGIN_HEADER', 0);
0325: -
0326: + define ('PDF_MARGIN_HEADER', 0);
0327: +
0328: /**
0329: - * footer margin
0330: + * Footer margin.
0331: */
0332: - define('PDF_MARGIN_FOOTER', 0);
0333: -
0334: + define ('PDF_MARGIN_FOOTER', 0);
0335: +
0336: /**
0337: - * top margin
0338: + * Top margin.
0339: */
0340: - define('PDF_MARGIN_TOP', 0);
0341: -
0342: + define ('PDF_MARGIN_TOP', 0);
0343: +
0344: /**
0345: - * bottom margin
0346: + * Bottom margin.
0347: */
0348: - define('PDF_MARGIN_BOTTOM', 0);
0349: -
0350: + define ('PDF_MARGIN_BOTTOM', 0);
0351: +
0352: /**
0353: - * left margin
0354: + * Left margin.
0355: */
0356: - define('PDF_MARGIN_LEFT', 0);
0357: -
0358: + define ('PDF_MARGIN_LEFT', 0);
0359: +
0360: /**
0361: - * right margin
0362: + * Right margin.
0363: */
0364: - define('PDF_MARGIN_RIGHT', 0);
0365: -
0366: + define ('PDF_MARGIN_RIGHT', 0);
0367: +
0368: /**
0369: - * default main font name
0370: + * Default main font name.
0371: */
0372: - define('PDF_FONT_NAME_MAIN', 'helvetica');
0373: -
0374: + define ('PDF_FONT_NAME_MAIN', 'helvetica');
0375: +
0376: /**
0377: - * default main font size
0378: + * Default main font size.
0379: */
0380: - define('PDF_FONT_SIZE_MAIN', 10);
0381: -
0382: + define ('PDF_FONT_SIZE_MAIN', 10);
0383: +
0384: /**
0385: - * default data font name
0386: + * Default data font name.
0387: */
0388: - define('PDF_FONT_NAME_DATA', 'helvetica');
0389: -
0390: + define ('PDF_FONT_NAME_DATA', 'helvetica');
0391: +
0392: /**
0393: - * default data font size
0394: + * Default data font size.
0395: */
0396: - define('PDF_FONT_SIZE_DATA', 8);
0397: -
0398: + define ('PDF_FONT_SIZE_DATA', 8);
0399: +
0400: /**
0401: - * default monospaced font name
0402: + * Default monospaced font name.
0403: */
0404: - define('PDF_FONT_MONOSPACED', 'courier');
0405: -
0406: + define ('PDF_FONT_MONOSPACED', 'courier');
0407: +
0408: /**
0409: - * ratio used to adjust the conversion of pixels to user units
0410: + * Ratio used to adjust the conversion of pixels to user units.
0411: */
0412: - define('PDF_IMAGE_SCALE_RATIO', 1);
0413: -
0414: + define ('PDF_IMAGE_SCALE_RATIO', 1);
0415: +
0416: /**
0417: - * magnification factor for titles
0418: + * Magnification factor for titles.
0419: */
0420: define('HEAD_MAGNIFICATION', 1);
0421: -
0422: +
0423: /**
0424: - * height of cell repect font height
0425: + * Height of cell respect font height.
0426: */
0427: define('K_CELL_HEIGHT_RATIO', 1);
0428: -
0429: +
0430: /**
0431: - * title magnification respect main font size
0432: + * Title magnification respect main font size.
0433: */
0434: define('K_TITLE_MAGNIFICATION', 1);
0435: -
0436: +
0437: /**
0438: - * reduction factor for small font
0439: + * Reduction factor for small font.
0440: */
0441: define('K_SMALL_RATIO', 2/3);
0442: -
0443: +
0444: /**
0445: - * set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language
0446: + * Set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language.
0447: */
0448: define('K_THAI_TOPCHARS', true);
0449: -
0450: +
0451: /**
0452: - * if true allows to call TCPDF methods using HTML syntax
0453: + * If true allows to call TCPDF methods using HTML syntax
0454: * IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
0455: */
0456: define('K_TCPDF_CALLS_IN_HTML', false);
0457: +
0458: + /**
0459: + * If true and PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution.
0460: + */
0461: + define('K_TCPDF_THROW_EXCEPTION_ERROR', false);
0462: }
0463:
0464: //============================================================+
0465: diff -Naurp html2pdf_v4.03.orig/examples/about.php html2pdf_v4.03.new/examples/about.php
0466: --- html2pdf_v4.03.orig/examples/about.php 2011-02-12 12:58:10.000000000 +0100
0467: +++ html2pdf_v4.03.new/examples/about.php 2013-06-04 17:54:04.941238352 +0200
0468: @@ -10,7 +10,7 @@
0469: * isset($_GET['vuehtml']) is not mandatory
0470: * it allow to display the result in the HTML format
0471: */
0472: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0473: + require_once('html2pdf/html2pdf.class.php');
0474:
0475: // get the HTML
0476: ob_start();
0477: diff -Naurp html2pdf_v4.03.orig/examples/bookmark.php html2pdf_v4.03.new/examples/bookmark.php
0478: --- html2pdf_v4.03.orig/examples/bookmark.php 2011-02-12 12:58:10.000000000 +0100
0479: +++ html2pdf_v4.03.new/examples/bookmark.php 2013-06-04 17:54:17.440337989 +0200
0480: @@ -97,7 +97,7 @@ ob_start();
0481: <?php
0482: $content = ob_get_clean();
0483:
0484: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0485: + require_once('html2pdf/html2pdf.class.php');
0486: try
0487: {
0488: $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8', 0);
0489: diff -Naurp html2pdf_v4.03.orig/examples/exemple00.php html2pdf_v4.03.new/examples/exemple00.php
0490: --- html2pdf_v4.03.orig/examples/exemple00.php 2011-02-12 12:58:10.000000000 +0100
0491: +++ html2pdf_v4.03.new/examples/exemple00.php 2013-06-04 17:54:30.268440918 +0200
0492: @@ -17,7 +17,7 @@
0493: $content = ob_get_clean();
0494:
0495: // convert in PDF
0496: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0497: + require_once('html2pdf/html2pdf.class.php');
0498: try
0499: {
0500: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0501: diff -Naurp html2pdf_v4.03.orig/examples/exemple01.php html2pdf_v4.03.new/examples/exemple01.php
0502: --- html2pdf_v4.03.orig/examples/exemple01.php 2011-02-12 12:58:10.000000000 +0100
0503: +++ html2pdf_v4.03.new/examples/exemple01.php 2013-06-04 17:54:39.776515727 +0200
0504: @@ -17,7 +17,7 @@
0505: $content = ob_get_clean();
0506:
0507: // convert in PDF
0508: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0509: + require_once('html2pdf/html2pdf.class.php');
0510: try
0511: {
0512: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0513: diff -Naurp html2pdf_v4.03.orig/examples/exemple02.php html2pdf_v4.03.new/examples/exemple02.php
0514: --- html2pdf_v4.03.orig/examples/exemple02.php 2011-02-12 12:58:10.000000000 +0100
0515: +++ html2pdf_v4.03.new/examples/exemple02.php 2013-06-04 17:54:49.480593528 +0200
0516: @@ -17,7 +17,7 @@
0517: $content = ob_get_clean();
0518:
0519: // convert in PDF
0520: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0521: + require_once('html2pdf/html2pdf.class.php');
0522: try
0523: {
0524: $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8', array(15, 5, 15, 5));
0525: diff -Naurp html2pdf_v4.03.orig/examples/exemple03.php html2pdf_v4.03.new/examples/exemple03.php
0526: --- html2pdf_v4.03.orig/examples/exemple03.php 2011-02-12 12:58:10.000000000 +0100
0527: +++ html2pdf_v4.03.new/examples/exemple03.php 2013-06-04 17:54:59.518673394 +0200
0528: @@ -17,7 +17,7 @@
0529: $content = ob_get_clean();
0530:
0531: // convert to PDF
0532: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0533: + require_once('html2pdf/html2pdf.class.php');
0534: try
0535: {
0536: $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8', 3);
0537: diff -Naurp html2pdf_v4.03.orig/examples/exemple04.php html2pdf_v4.03.new/examples/exemple04.php
0538: --- html2pdf_v4.03.orig/examples/exemple04.php 2011-02-12 12:58:10.000000000 +0100
0539: +++ html2pdf_v4.03.new/examples/exemple04.php 2013-06-04 17:55:07.281735251 +0200
0540: @@ -17,7 +17,7 @@
0541: $content = ob_get_clean();
0542:
0543: // convert to PDF
0544: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0545: + require_once('html2pdf/html2pdf.class.php');
0546: try
0547: {
0548: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0549: diff -Naurp html2pdf_v4.03.orig/examples/exemple05.php html2pdf_v4.03.new/examples/exemple05.php
0550: --- html2pdf_v4.03.orig/examples/exemple05.php 2011-02-12 12:58:10.000000000 +0100
0551: +++ html2pdf_v4.03.new/examples/exemple05.php 2013-06-04 17:55:15.229798832 +0200
0552: @@ -17,7 +17,7 @@
0553: $content = ob_get_clean();
0554:
0555: // convert to PDF
0556: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0557: + require_once('html2pdf/html2pdf.class.php');
0558: try
0559: {
0560: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0561: diff -Naurp html2pdf_v4.03.orig/examples/exemple06.php html2pdf_v4.03.new/examples/exemple06.php
0562: --- html2pdf_v4.03.orig/examples/exemple06.php 2011-02-12 12:58:10.000000000 +0100
0563: +++ html2pdf_v4.03.new/examples/exemple06.php 2013-06-04 17:55:22.501856929 +0200
0564: @@ -17,7 +17,7 @@
0565: $content = ob_get_clean();
0566:
0567: // convert to PDF
0568: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0569: + require_once('html2pdf/html2pdf.class.php');
0570: try
0571: {
0572: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0573: diff -Naurp html2pdf_v4.03.orig/examples/exemple07.php html2pdf_v4.03.new/examples/exemple07.php
0574: --- html2pdf_v4.03.orig/examples/exemple07.php 2011-02-12 12:58:10.000000000 +0100
0575: +++ html2pdf_v4.03.new/examples/exemple07.php 2013-06-04 17:55:32.817938626 +0200
0576: @@ -18,7 +18,7 @@
0577: $content = ob_get_clean();
0578:
0579: // convert to PDF
0580: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0581: + require_once('html2pdf/html2pdf.class.php');
0582: try
0583: {
0584: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0585: diff -Naurp html2pdf_v4.03.orig/examples/exemple08.php html2pdf_v4.03.new/examples/exemple08.php
0586: --- html2pdf_v4.03.orig/examples/exemple08.php 2011-02-12 12:58:10.000000000 +0100
0587: +++ html2pdf_v4.03.new/examples/exemple08.php 2013-06-04 17:55:40.159998079 +0200
0588: @@ -17,7 +17,7 @@
0589: $content = ob_get_clean();
0590:
0591: // convert to PDF
0592: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0593: + require_once('html2pdf/html2pdf.class.php');
0594: try
0595: {
0596: $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8', 0);
0597: diff -Naurp html2pdf_v4.03.orig/examples/exemple09.php html2pdf_v4.03.new/examples/exemple09.php
0598: --- html2pdf_v4.03.orig/examples/exemple09.php 2011-02-12 12:58:10.000000000 +0100
0599: +++ html2pdf_v4.03.new/examples/exemple09.php 2013-06-04 17:55:58.225139527 +0200
0600: @@ -51,7 +51,7 @@ Bonjour <b><?php echo $nom; ?></b>, ton
0601: <?php
0602: if ($generate) {
0603: $content = ob_get_clean();
0604: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0605: + require_once('html2pdf/html2pdf.class.php');
0606: try
0607: {
0608: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0609: diff -Naurp html2pdf_v4.03.orig/examples/exemple10.php html2pdf_v4.03.new/examples/exemple10.php
0610: --- html2pdf_v4.03.orig/examples/exemple10.php 2011-04-05 16:43:45.000000000 +0200
0611: +++ html2pdf_v4.03.new/examples/exemple10.php 2013-06-04 17:56:15.675280844 +0200
0612: @@ -15,7 +15,7 @@
0613: include(dirname(__FILE__).'/res/exemple10.php');
0614: $content = ob_get_clean();
0615:
0616: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0617: + require_once('html2pdf/html2pdf.class.php');
0618: try
0619: {
0620: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0621: diff -Naurp html2pdf_v4.03.orig/examples/exemple11.php html2pdf_v4.03.new/examples/exemple11.php
0622: --- html2pdf_v4.03.orig/examples/exemple11.php 2011-02-12 12:58:10.000000000 +0100
0623: +++ html2pdf_v4.03.new/examples/exemple11.php 2013-06-04 17:56:25.290358057 +0200
0624: @@ -17,7 +17,7 @@
0625: $content = ob_get_clean();
0626:
0627: // convert to PDF
0628: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0629: + require_once('html2pdf/html2pdf.class.php');
0630: try
0631: {
0632: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0633: diff -Naurp html2pdf_v4.03.orig/examples/exemple12.php html2pdf_v4.03.new/examples/exemple12.php
0634: --- html2pdf_v4.03.orig/examples/exemple12.php 2011-02-12 12:58:10.000000000 +0100
0635: +++ html2pdf_v4.03.new/examples/exemple12.php 2013-06-04 17:56:34.014427184 +0200
0636: @@ -17,7 +17,7 @@
0637: $content = ob_get_clean();
0638:
0639: // convert to PDF
0640: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0641: + require_once('html2pdf/html2pdf.class.php');
0642: try
0643: {
0644: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0645: diff -Naurp html2pdf_v4.03.orig/examples/exemple13.php html2pdf_v4.03.new/examples/exemple13.php
0646: --- html2pdf_v4.03.orig/examples/exemple13.php 2011-02-12 12:58:10.000000000 +0100
0647: +++ html2pdf_v4.03.new/examples/exemple13.php 2013-06-04 17:56:41.301485329 +0200
0648: @@ -17,7 +17,7 @@
0649: $content = ob_get_clean();
0650:
0651: // convert to PDF
0652: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0653: + require_once('html2pdf/html2pdf.class.php');
0654: try
0655: {
0656: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0657: diff -Naurp html2pdf_v4.03.orig/examples/forms.php html2pdf_v4.03.new/examples/forms.php
0658: --- html2pdf_v4.03.orig/examples/forms.php 2011-05-26 18:01:10.000000000 +0200
0659: +++ html2pdf_v4.03.new/examples/forms.php 2013-06-04 17:56:50.126555710 +0200
0660: @@ -25,7 +25,7 @@
0661: $content = ob_get_clean();
0662:
0663: // convert to PDF
0664: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0665: + require_once('html2pdf/html2pdf.class.php');
0666: try
0667: {
0668: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0669: diff -Naurp html2pdf_v4.03.orig/examples/groups.php html2pdf_v4.03.new/examples/groups.php
0670: --- html2pdf_v4.03.orig/examples/groups.php 2011-04-07 09:47:13.000000000 +0200
0671: +++ html2pdf_v4.03.new/examples/groups.php 2013-06-04 17:56:56.995610544 +0200
0672: @@ -57,7 +57,7 @@ ob_start();
0673: <?php
0674: $content = ob_get_clean();
0675:
0676: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0677: + require_once('html2pdf/html2pdf.class.php');
0678: try
0679: {
0680: $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8', 0);
0681: diff -Naurp html2pdf_v4.03.orig/examples/js1.php html2pdf_v4.03.new/examples/js1.php
0682: --- html2pdf_v4.03.orig/examples/js1.php 2011-02-12 12:58:10.000000000 +0100
0683: +++ html2pdf_v4.03.new/examples/js1.php 2013-06-04 17:57:06.131683356 +0200
0684: @@ -23,7 +23,7 @@
0685: $content = ob_get_clean();
0686:
0687: // convert to PDF
0688: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0689: + require_once('html2pdf/html2pdf.class.php');
0690: try
0691: {
0692: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0693: diff -Naurp html2pdf_v4.03.orig/examples/js2.php html2pdf_v4.03.new/examples/js2.php
0694: --- html2pdf_v4.03.orig/examples/js2.php 2011-02-12 12:58:10.000000000 +0100
0695: +++ html2pdf_v4.03.new/examples/js2.php 2013-06-04 17:57:13.168739511 +0200
0696: @@ -23,7 +23,7 @@
0697: $content = ob_get_clean();
0698:
0699: // convert to PDF
0700: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0701: + require_once('html2pdf/html2pdf.class.php');
0702: try
0703: {
0704: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0705: diff -Naurp html2pdf_v4.03.orig/examples/js3.php html2pdf_v4.03.new/examples/js3.php
0706: --- html2pdf_v4.03.orig/examples/js3.php 2011-02-12 12:58:10.000000000 +0100
0707: +++ html2pdf_v4.03.new/examples/js3.php 2013-06-04 17:57:21.685807370 +0200
0708: @@ -29,7 +29,7 @@ app.alert('Vous vous appelez '+rep);
0709: ";
0710:
0711: // convert to PDF
0712: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0713: + require_once('html2pdf/html2pdf.class.php');
0714: try
0715: {
0716: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0717: diff -Naurp html2pdf_v4.03.orig/examples/qrcode.php html2pdf_v4.03.new/examples/qrcode.php
0718: --- html2pdf_v4.03.orig/examples/qrcode.php 2011-02-12 12:58:10.000000000 +0100
0719: +++ html2pdf_v4.03.new/examples/qrcode.php 2013-06-04 17:57:29.539870020 +0200
0720: @@ -51,7 +51,7 @@
0721: $content = ob_get_clean();
0722:
0723: // convert to PDF
0724: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0725: + require_once('html2pdf/html2pdf.class.php');
0726: try
0727: {
0728: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0729: diff -Naurp html2pdf_v4.03.orig/examples/radius.php html2pdf_v4.03.new/examples/radius.php
0730: --- html2pdf_v4.03.orig/examples/radius.php 2011-02-12 12:58:10.000000000 +0100
0731: +++ html2pdf_v4.03.new/examples/radius.php 2013-06-04 17:57:35.923920864 +0200
0732: @@ -40,7 +40,7 @@
0733: $content = ob_get_clean();
0734:
0735: // convert to PDF
0736: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0737: + require_once('html2pdf/html2pdf.class.php');
0738: try
0739: {
0740: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0741: diff -Naurp html2pdf_v4.03.orig/examples/regle.php html2pdf_v4.03.new/examples/regle.php
0742: --- html2pdf_v4.03.orig/examples/regle.php 2011-02-12 12:58:10.000000000 +0100
0743: +++ html2pdf_v4.03.new/examples/regle.php 2013-06-04 17:57:41.953969022 +0200
0744: @@ -45,7 +45,7 @@
0745: $content = ob_get_clean();
0746:
0747: // convert to PDF
0748: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0749: + require_once('html2pdf/html2pdf.class.php');
0750: try
0751: {
0752: $html2pdf = new HTML2PDF('L', 'A4', 'fr', true, 'UTF-8', 10);
0753: diff -Naurp html2pdf_v4.03.orig/examples/res/about.php html2pdf_v4.03.new/examples/res/about.php
0754: --- html2pdf_v4.03.orig/examples/res/about.php 2011-03-14 21:52:38.000000000 +0100
0755: +++ html2pdf_v4.03.new/examples/res/about.php 2013-06-04 17:51:47.650143574 +0200
0756: @@ -17,7 +17,7 @@
0757: A propos de ...
0758: </td>
0759: <td style="width: 50%; text-align: right">
0760: - HTML2PDF v<?php echo __CLASS_HTML2PDF__; ?>
0761: + HTML2PDF <?php echo defined('__CLASS_HTML2PDF__')? 'v' . __CLASS_HTML2PDF__: 'non-charg��'; ?>
0762: </td>
0763: </tr>
0764: </table>
0765: @@ -40,7 +40,7 @@
0766: <bookmark title="Pr��sentation" level="0" ></bookmark>
0767: <br><br><br><br><br><br><br><br>
0768: <h1>HTML2PDF</h1>
0769: - <h3>v<?php echo __CLASS_HTML2PDF__; ?></h3><br>
0770: + <h3><?php echo defined('__CLASS_HTML2PDF__')? 'v' . __CLASS_HTML2PDF__: 'non-charg��'; ?></h3><br>
0771: <br><br><br><br><br>
0772: <div style="text-align: center; width: 100%;">
0773: <br>
0774: diff -Naurp html2pdf_v4.03.orig/examples/res/exemple01.php html2pdf_v4.03.new/examples/res/exemple01.php
0775: --- html2pdf_v4.03.orig/examples/res/exemple01.php 2011-02-12 12:58:46.000000000 +0100
0776: +++ html2pdf_v4.03.new/examples/res/exemple01.php 2013-05-31 14:26:00.818920032 +0200
0777: @@ -93,4 +93,4 @@ table.morpion td.j2 { color: #A00; }
0778: </td>
0779: </tr>
0780: </table>
0781: -</page>
0782: \ No newline at end of file
0783: +</page>
0784: diff -Naurp html2pdf_v4.03.orig/examples/res/utf8test.txt html2pdf_v4.03.new/examples/res/utf8test.txt
0785: --- html2pdf_v4.03.orig/examples/res/utf8test.txt 1970-01-01 01:00:00.000000000 +0100
0786: +++ html2pdf_v4.03.new/examples/res/utf8test.txt 2011-02-11 22:45:55.000000000 +0100
0787: @@ -0,0 +1,120 @@
0788: +Sentences that contain all letters commonly used in a language
0789: +--------------------------------------------------------------
0790: +
0791: +Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/> -- 2001-09-02
0792: +
0793: +This file is UTF-8 encoded.
0794: +
0795: +
0796: +Danish (da)
0797: +---------
0798: +
0799: + Quizdeltagerne spiste jordb��r med fl��de, mens cirkusklovnen
0800: + Wolther spillede p�� xylofon.
0801: + (= Quiz contestants were eating strawbery with cream while Wolther
0802: + the circus clown played on xylophone.)
0803: +
0804: +German (de)
0805: +-----------
0806: +
0807: + Falsches ��ben von Xylophonmusik qu��lt jeden gr����eren Zwerg
0808: + (= Wrongful practicing of xylophone music tortures every larger dwarf)
0809: +
0810: + Zw��lf Boxk��mpfer jagten Eva quer ��ber den Sylter Deich
0811: + (= Twelve boxing fighters hunted Eva across the dike of Sylt)
0812: +
0813: + Heiz��lr��cksto��abd��mpfung
0814: + (= fuel oil recoil absorber)
0815: + (jqvwxy missing, but all non-ASCII letters in one word)
0816: +
0817: +English (en)
0818: +------------
0819: +
0820: + The quick brown fox jumps over the lazy dog
0821: +
0822: +Spanish (es)
0823: +------------
0824: +
0825: + El ping��ino Wenceslao hizo kil��metros bajo exhaustiva lluvia y
0826: + fr��o, a��oraba a su querido cachorro.
0827: + (Contains every letter and every accent, but not every combination
0828: + of vowel + acute.)
0829: +
0830: +French (fr)
0831: +-----------
0832: +
0833: + Portez ce vieux whisky au juge blond qui fume sur son ��le int��rieure, ��
0834: + c��t�� de l'alc��ve ovo��de, o�� les b��ches se consument dans l'��tre, ce
0835: + qui lui permet de penser �� la c��nogen��se de l'��tre dont il est question
0836: + dans la cause ambigu�� entendue �� Mo��, dans un capharna��m qui,
0837: + pense-t-il, diminue ���� et l�� la qualit�� de son ��uvre.
0838: +
0839: + l'��le exigu��
0840: + O�� l'ob��se jury m��r
0841: + F��te l'ha�� volap��k,
0842: + ��ne ex a��quo au whist,
0843: + ��tez ce v��u d����u.
0844: +
0845: + Le c��ur d����u mais l'��me plut��t na��ve, Lou��s r��va de crapa��ter en
0846: + cano�� au del�� des ��les, pr��s du m��lstr��m o�� br��lent les nov��.
0847: +
0848: +Irish Gaelic (ga)
0849: +-----------------
0850: +
0851: + D'fhuascail ��osa, ��rmhac na h��ighe Beannaithe, p��r ��ava agus ��dhaimh
0852: +
0853: +Hungarian (hu)
0854: +--------------
0855: +
0856: + ��rv��zt��r�� t��k��rf��r��g��p
0857: + (= flood-proof mirror-drilling machine, only all non-ASCII letters)
0858: +
0859: +Icelandic (is)
0860: +--------------
0861: +
0862: + K��mi n�� ��xi h��r ykist ��j��fum n�� b����i v��l og ��drepa
0863: +
0864: + S��v��r gr��t ����an ��v�� ��lpan var ��n��t
0865: + (some ASCII letters missing)
0866: +
0867: +Greek (el)
0868: +-------------
0869: +
0870: + ������������ ������� ��������������� ������� ����� ������� ������� ������� ��������������� ������������
0871: + (= No more shall I see acacias or myrtles in the golden clearing)
0872: +
0873: + ������������������ ������� ������������������ ������������������
0874: + (= I uncover the soul-destroying abhorrence)
0875: +
0876: +Hebrew (iw)
0877: +-----------
0878: +
0879: + ? ���� �������� ���� ������ ������������ ���������� ������ ���� �������� ������ ������������
0880: +
0881: +Polish (pl)
0882: +-----------
0883: +
0884: + Pchn���� w t�� ����d�� je��a lub o��m skrzy�� fig
0885: + (= To push a hedgehog or eight bins of figs in this boat)
0886: +
0887: +Russian (ru)
0888: +------------
0889: +
0890: + �� ���������� ������ ������ ���� ������������? ����, ���� ������������������ ������������������!
0891: + (= Would a citrus live in the bushes of south? Yes, but only a fake one!)
0892: +
0893: +Thai (th)
0894: +---------
0895: +
0896: + [--------------------------|------------------------]
0897: + ��� ��������������������������������������������������������������������������������������������� ���������������������������������������������������������������������������
0898: + ������������������������������������������������������������ ������������������������������������������������������������������������������������
0899: + ��������������������������������������������������������������������������������������� ���������������������������������������������������������������������������
0900: + ��������������������������������������������������������������������� ������������������������������������ ������������ ��������������������������� ���
0901: +
0902: + [The copyright for the Thai example is owned by The Computer
0903: + Association of Thailand under the Royal Patronage of His Majesty the
0904: + King.]
0905: +
0906: +Please let me know if you find others! Special thanks to the people
0907: +from all over the world who contributed these sentences.
0908: diff -Naurp html2pdf_v4.03.orig/examples/svg.php html2pdf_v4.03.new/examples/svg.php
0909: --- html2pdf_v4.03.orig/examples/svg.php 2011-04-29 13:36:14.000000000 +0200
0910: +++ html2pdf_v4.03.new/examples/svg.php 2013-06-04 17:57:51.344043929 +0200
0911: @@ -17,7 +17,7 @@
0912: $content = ob_get_clean();
0913:
0914: // convert into PDF
0915: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0916: + require_once('html2pdf/html2pdf.class.php');
0917: try
0918: {
0919: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0920: diff -Naurp html2pdf_v4.03.orig/examples/svg_tiger.php html2pdf_v4.03.new/examples/svg_tiger.php
0921: --- html2pdf_v4.03.orig/examples/svg_tiger.php 2011-04-29 13:36:14.000000000 +0200
0922: +++ html2pdf_v4.03.new/examples/svg_tiger.php 2013-06-04 17:58:00.031113220 +0200
0923: @@ -260,7 +260,7 @@ $content = '
0924: </page>';
0925:
0926: // convert to PDF
0927: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0928: + require_once('html2pdf/html2pdf.class.php');
0929: try
0930: {
0931: $html2pdf = new HTML2PDF('L', 'A4', 'fr');
0932: diff -Naurp html2pdf_v4.03.orig/examples/svg_tree.php html2pdf_v4.03.new/examples/svg_tree.php
0933: --- html2pdf_v4.03.orig/examples/svg_tree.php 2011-04-29 13:36:14.000000000 +0200
0934: +++ html2pdf_v4.03.new/examples/svg_tree.php 2013-06-04 17:58:07.038169049 +0200
0935: @@ -126,7 +126,7 @@ $content = '
0936: </page>';
0937:
0938: // onvert to PDF
0939: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0940: + require_once('html2pdf/html2pdf.class.php');
0941: try
0942: {
0943: $html2pdf = new HTML2PDF('P', 'A4', 'fr');
0944: diff -Naurp html2pdf_v4.03.orig/examples/ticket.php html2pdf_v4.03.new/examples/ticket.php
0945: --- html2pdf_v4.03.orig/examples/ticket.php 2011-04-29 13:36:14.000000000 +0200
0946: +++ html2pdf_v4.03.new/examples/ticket.php 2013-06-04 17:58:14.707230464 +0200
0947: @@ -83,7 +83,7 @@
0948: $content = ob_get_clean();
0949:
0950: // convert
0951: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0952: + require_once('html2pdf/html2pdf.class.php');
0953: try
0954: {
0955: $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8', 0);
0956: diff -Naurp html2pdf_v4.03.orig/examples/utf8.php html2pdf_v4.03.new/examples/utf8.php
0957: --- html2pdf_v4.03.orig/examples/utf8.php 2011-04-07 22:37:52.000000000 +0200
0958: +++ html2pdf_v4.03.new/examples/utf8.php 2013-06-04 17:58:51.998527717 +0200
0959: @@ -11,10 +11,10 @@
0960: * it allow to display the result in the HTML format
0961: */
0962:
0963: - require_once(dirname(__FILE__).'/../html2pdf.class.php');
0964: + require_once('html2pdf/html2pdf.class.php');
0965:
0966: // get the HTML
0967: - $content = file_get_contents(dirname(__FILE__).'/../_tcpdf_'.HTML2PDF_USED_TCPDF_VERSION.'/cache/utf8test.txt');
0968: + $content = file_get_contents(dirname(__FILE__).'/res/utf8test.txt');
0969: $content = '<page style="font-family: freeserif"><br />'.nl2br($content).'</page>';
0970:
0971: // convert to PDF
0972: diff -Naurp html2pdf_v4.03.orig/html2pdf.class.php html2pdf_v4.03.new/html2pdf.class.php
0973: --- html2pdf_v4.03.orig/html2pdf.class.php 2011-05-27 13:23:06.000000000 +0200
0974: +++ html2pdf_v4.03.new/html2pdf.class.php 2013-06-05 11:26:48.891070375 +0200
0975: @@ -12,7 +12,6 @@
0976: if (!defined('__CLASS_HTML2PDF__')) {
0977:
0978: define('__CLASS_HTML2PDF__', '4.03');
0979: - define('HTML2PDF_USED_TCPDF_VERSION', '5.0.002');
0980:
0981: require_once(dirname(__FILE__).'/_class/exception.class.php');
0982: require_once(dirname(__FILE__).'/_class/locale.class.php');
0983: @@ -109,8 +108,8 @@ if (!defined('__CLASS_HTML2PDF__')) {
0984: protected $_debugStartTime = 0; // debug start time
0985: protected $_debugLastTime = 0; // debug stop time
0986:
0987: - static protected $_subobj = null; // object html2pdf prepared in order to accelerate the creation of sub html2pdf
0988: - static protected $_tables = array(); // static table to prepare the nested html tables
0989: + protected $_subobj = null; // object html2pdf prepared in order to accelerate the creation of sub html2pdf
0990: + protected $_tables; // table to prepare the nested html tables
0991:
0992: /**
0993: * class constructor
0994: @@ -126,6 +125,10 @@ if (!defined('__CLASS_HTML2PDF__')) {
0995: */
0996: public function __construct($orientation = 'P', $format = 'A4', $langue='fr', $unicode=true, $encoding='UTF-8', $marges = array(5, 5, 5, 8))
0997: {
0998: + // Be sure we have a reference.
0999: + $tables = array();
1000: + $this->_tables = &$tables;
1001: +
1002: // init the page number
1003: $this->_page = 0;
1004: $this->_firstPage = true;
1005: @@ -185,15 +188,20 @@ if (!defined('__CLASS_HTML2PDF__')) {
1006: }
1007:
1008: /**
1009: - * Clone to create a sub HTML2PDF from HTML2PDF::$_subobj
1010: + * Clone to create a sub HTML2PDF from $this->_subobj
1011: *
1012: * @access public
1013: */
1014: public function __clone()
1015: {
1016: - $this->pdf = clone $this->pdf;
1017: - $this->parsingHtml = clone $this->parsingHtml;
1018: - $this->parsingCss = clone $this->parsingCss;
1019: + // TCPDF lacks a good deep cloning support, thus do it here lazily.
1020: + foreach ($this as $key => $val) {
1021: + if (is_object($val) || is_array($val)) {
1022: + if ($key != '_tables') {
1023: + $this->$key = unserialize(serialize($val));
1024: + }
1025: + }
1026: + }
1027: $this->parsingCss->setPdfParent($this->pdf);
1028: }
1029:
1030: @@ -320,8 +328,9 @@ if (!defined('__CLASS_HTML2PDF__')) {
1031: */
1032: protected function _cleanUp()
1033: {
1034: - HTML2PDF::$_subobj = null;
1035: - HTML2PDF::$_tables = array();
1036: + $this->_subobj = null;
1037: + $tables = array();
1038: + $this->_tables = &$tables;
1039: }
1040:
1041: /**
1042: @@ -934,7 +943,7 @@ if (!defined('__CLASS_HTML2PDF__')) {
1043: $pdf = null;
1044:
1045: // create the sub object
1046: - HTML2PDF::$_subobj = new HTML2PDF(
1047: + $this->_subobj = new HTML2PDF(
1048: $this->_orientation,
1049: $this->_format,
1050: $this->_langue,
1051: @@ -944,18 +953,19 @@ if (!defined('__CLASS_HTML2PDF__')) {
1052: );
1053:
1054: // init
1055: - HTML2PDF::$_subobj->setTestTdInOnePage($this->_testTdInOnepage);
1056: - HTML2PDF::$_subobj->setTestIsImage($this->_testIsImage);
1057: - HTML2PDF::$_subobj->setTestIsDeprecated($this->_testIsDeprecated);
1058: - HTML2PDF::$_subobj->setDefaultFont($this->_defaultFont);
1059: - HTML2PDF::$_subobj->parsingCss->css = &$this->parsingCss->css;
1060: - HTML2PDF::$_subobj->parsingCss->cssKeys = &$this->parsingCss->cssKeys;
1061: + $this->_subobj->_tables = &$this->_tables;
1062: + $this->_subobj->setTestTdInOnePage($this->_testTdInOnepage);
1063: + $this->_subobj->setTestIsImage($this->_testIsImage);
1064: + $this->_subobj->setTestIsDeprecated($this->_testIsDeprecated);
1065: + $this->_subobj->setDefaultFont($this->_defaultFont);
1066: + $this->_subobj->parsingCss->css = &$this->parsingCss->css;
1067: + $this->_subobj->parsingCss->cssKeys = &$this->parsingCss->cssKeys;
1068:
1069: // clone font from the original PDF
1070: - HTML2PDF::$_subobj->pdf->cloneFontFrom($this->pdf);
1071: + $this->_subobj->pdf->cloneFontFrom($this->pdf);
1072:
1073: // remove the link to the parent
1074: - HTML2PDF::$_subobj->parsingCss->setPdfParent($pdf);
1075: + $this->_subobj->parsingCss->setPdfParent($pdf);
1076: }
1077:
1078: /**
1079: @@ -968,7 +978,7 @@ if (!defined('__CLASS_HTML2PDF__')) {
1080: protected function _createSubHTML(&$subHtml, $cellmargin=0)
1081: {
1082: // prepare the subObject, if never prepare before
1083: - if (HTML2PDF::$_subobj===null) {
1084: + if ($this->_subobj===null) {
1085: $this->_prepareSubObj();
1086: }
1087:
1088: @@ -983,10 +993,11 @@ if (!defined('__CLASS_HTML2PDF__')) {
1089: }
1090:
1091: // BUGFIX : we have to call the method, because of a bug in php 5.1.6
1092: - HTML2PDF::$_subobj->pdf->getPage();
1093: + $this->_subobj->pdf->getPage();
1094:
1095: // clone the sub oject
1096: - $subHtml = clone HTML2PDF::$_subobj;
1097: + $subHtml = clone $this->_subobj;
1098: + $subHtml->_tables = &$this->_tables;
1099: $subHtml->parsingCss->table = $this->parsingCss->table;
1100: $subHtml->parsingCss->value = $this->parsingCss->value;
1101: $subHtml->initSubHtml(
1102: @@ -1007,7 +1018,6 @@ if (!defined('__CLASS_HTML2PDF__')) {
1103: */
1104: protected function _destroySubHTML(&$subHtml)
1105: {
1106: - unset($subHtml);
1107: $subHtml = null;
1108: }
1109:
1110: @@ -3488,6 +3498,9 @@ if (!defined('__CLASS_HTML2PDF__')) {
1111: $this->parsingCss->value['font-size']=$fontSize*0.5; $this->_tag_open_BR($param);
1112: $this->parsingCss->value['font-size']=$fontSize;
1113:
1114: + // Restore font size in producer.
1115: + $this->pdf->SetFontSize(720 * $fontSize / 254);
1116: +
1117: $this->parsingCss->value['text-align'] = $oldAlign;
1118: $this->_setNewPositionForNewLine();
1119:
1120: @@ -4603,18 +4616,18 @@ if (!defined('__CLASS_HTML2PDF__')) {
1121:
1122: // if we are in a sub part, save the number of the first TR in the thead
1123: if ($this->_subPart) {
1124: - HTML2PDF::$_tables[$param['num']]['thead']['tr'][0] = HTML2PDF::$_tables[$param['num']]['tr_curr'];
1125: - HTML2PDF::$_tables[$param['num']]['thead']['code'] = array();
1126: + $this->_tables[$param['num']]['thead']['tr'][0] = $this->_tables[$param['num']]['tr_curr'];
1127: + $this->_tables[$param['num']]['thead']['code'] = array();
1128: for ($pos=$this->_tempPos; $pos<count($this->parsingHtml->code); $pos++) {
1129: $action = $this->parsingHtml->code[$pos];
1130: if (strtolower($action['name'])=='thead') $action['name'] = 'thead_sub';
1131: - HTML2PDF::$_tables[$param['num']]['thead']['code'][] = $action;
1132: + $this->_tables[$param['num']]['thead']['code'][] = $action;
1133: if (strtolower($action['name'])=='thead_sub' && $action['close']) break;
1134: }
1135: } else {
1136: $level = $this->parsingHtml->getLevel($this->_parsePos);
1137: $this->_parsePos+= count($level);
1138: - HTML2PDF::$_tables[$param['num']]['tr_curr']+= count(HTML2PDF::$_tables[$param['num']]['thead']['tr']);
1139: + $this->_tables[$param['num']]['tr_curr']+= count($this->_tables[$param['num']]['thead']['tr']);
1140: }
1141:
1142: return true;
1143: @@ -4636,9 +4649,9 @@ if (!defined('__CLASS_HTML2PDF__')) {
1144:
1145: // if we are in a sub HTM, construct the list of the TR in the thead
1146: if ($this->_subPart) {
1147: - $min = HTML2PDF::$_tables[$param['num']]['thead']['tr'][0];
1148: - $max = HTML2PDF::$_tables[$param['num']]['tr_curr']-1;
1149: - HTML2PDF::$_tables[$param['num']]['thead']['tr'] = range($min, $max);
1150: + $min = $this->_tables[$param['num']]['thead']['tr'][0];
1151: + $max = $this->_tables[$param['num']]['tr_curr']-1;
1152: + $this->_tables[$param['num']]['thead']['tr'] = range($min, $max);
1153: }
1154:
1155: return true;
1156: @@ -4662,18 +4675,18 @@ if (!defined('__CLASS_HTML2PDF__')) {
1157:
1158: // if we are in a sub part, save the number of the first TR in the tfoot
1159: if ($this->_subPart) {
1160: - HTML2PDF::$_tables[$param['num']]['tfoot']['tr'][0] = HTML2PDF::$_tables[$param['num']]['tr_curr'];
1161: - HTML2PDF::$_tables[$param['num']]['tfoot']['code'] = array();
1162: + $this->_tables[$param['num']]['tfoot']['tr'][0] = $this->_tables[$param['num']]['tr_curr'];
1163: + $this->_tables[$param['num']]['tfoot']['code'] = array();
1164: for ($pos=$this->_tempPos; $pos<count($this->parsingHtml->code); $pos++) {
1165: $action = $this->parsingHtml->code[$pos];
1166: if (strtolower($action['name'])=='tfoot') $action['name'] = 'tfoot_sub';
1167: - HTML2PDF::$_tables[$param['num']]['tfoot']['code'][] = $action;
1168: + $this->_tables[$param['num']]['tfoot']['code'][] = $action;
1169: if (strtolower($action['name'])=='tfoot_sub' && $action['close']) break;
1170: }
1171: } else {
1172: $level = $this->parsingHtml->getLevel($this->_parsePos);
1173: $this->_parsePos+= count($level);
1174: - HTML2PDF::$_tables[$param['num']]['tr_curr']+= count(HTML2PDF::$_tables[$param['num']]['tfoot']['tr']);
1175: + $this->_tables[$param['num']]['tr_curr']+= count($this->_tables[$param['num']]['tfoot']['tr']);
1176: }
1177:
1178: return true;
1179: @@ -4695,9 +4708,9 @@ if (!defined('__CLASS_HTML2PDF__')) {
1180:
1181: // if we are in a sub HTM, construct the list of the TR in the tfoot
1182: if ($this->_subPart) {
1183: - $min = HTML2PDF::$_tables[$param['num']]['tfoot']['tr'][0];
1184: - $max = HTML2PDF::$_tables[$param['num']]['tr_curr']-1;
1185: - HTML2PDF::$_tables[$param['num']]['tfoot']['tr'] = range($min, $max);
1186: + $min = $this->_tables[$param['num']]['tfoot']['tr'][0];
1187: + $max = $this->_tables[$param['num']]['tr_curr']-1;
1188: + $this->_tables[$param['num']]['tfoot']['tr'] = range($min, $max);
1189: }
1190:
1191: return true;
1192: @@ -4867,63 +4880,63 @@ if (!defined('__CLASS_HTML2PDF__')) {
1193: // if we are in a SUB html => prepare the properties of the table
1194: if ($this->_subPart) {
1195: if ($this->_debugActif) $this->_DEBUG_add('Table n'.$param['num'], true);
1196: - HTML2PDF::$_tables[$param['num']] = array();
1197: - HTML2PDF::$_tables[$param['num']]['border'] = isset($param['border']) ? $this->parsingCss->readBorder($param['border']) : null;
1198: - HTML2PDF::$_tables[$param['num']]['cellpadding'] = $this->parsingCss->ConvertToMM(isset($param['cellpadding']) ? $param['cellpadding'] : '1px');
1199: - HTML2PDF::$_tables[$param['num']]['cellspacing'] = $this->parsingCss->ConvertToMM(isset($param['cellspacing']) ? $param['cellspacing'] : '2px');
1200: - HTML2PDF::$_tables[$param['num']]['cases'] = array(); // properties of each TR/TD
1201: - HTML2PDF::$_tables[$param['num']]['corr'] = array(); // link between TR/TD and colspan/rowspan
1202: - HTML2PDF::$_tables[$param['num']]['corr_x'] = 0; // position in 'cases'
1203: - HTML2PDF::$_tables[$param['num']]['corr_y'] = 0; // position in 'cases'
1204: - HTML2PDF::$_tables[$param['num']]['td_curr'] = 0; // current column
1205: - HTML2PDF::$_tables[$param['num']]['tr_curr'] = 0; // current row
1206: - HTML2PDF::$_tables[$param['num']]['curr_x'] = $this->pdf->getX();
1207: - HTML2PDF::$_tables[$param['num']]['curr_y'] = $this->pdf->getY();
1208: - HTML2PDF::$_tables[$param['num']]['width'] = 0; // global width
1209: - HTML2PDF::$_tables[$param['num']]['height'] = 0; // global height
1210: - HTML2PDF::$_tables[$param['num']]['align'] = $alignObject;
1211: - HTML2PDF::$_tables[$param['num']]['marge'] = array();
1212: - HTML2PDF::$_tables[$param['num']]['marge']['t'] = $this->parsingCss->value['padding']['t']+$this->parsingCss->value['border']['t']['width']+HTML2PDF::$_tables[$param['num']]['cellspacing']*0.5;
1213: - HTML2PDF::$_tables[$param['num']]['marge']['r'] = $this->parsingCss->value['padding']['r']+$this->parsingCss->value['border']['r']['width']+HTML2PDF::$_tables[$param['num']]['cellspacing']*0.5;
1214: - HTML2PDF::$_tables[$param['num']]['marge']['b'] = $this->parsingCss->value['padding']['b']+$this->parsingCss->value['border']['b']['width']+HTML2PDF::$_tables[$param['num']]['cellspacing']*0.5;
1215: - HTML2PDF::$_tables[$param['num']]['marge']['l'] = $this->parsingCss->value['padding']['l']+$this->parsingCss->value['border']['l']['width']+HTML2PDF::$_tables[$param['num']]['cellspacing']*0.5;
1216: - HTML2PDF::$_tables[$param['num']]['page'] = 0; // number of pages
1217: - HTML2PDF::$_tables[$param['num']]['new_page'] = true; // flag : new page for the current TR
1218: - HTML2PDF::$_tables[$param['num']]['style_value'] = null; // CSS style of the table
1219: - HTML2PDF::$_tables[$param['num']]['thead'] = array(); // properties on the thead
1220: - HTML2PDF::$_tables[$param['num']]['tfoot'] = array(); // properties on the tfoot
1221: - HTML2PDF::$_tables[$param['num']]['thead']['tr'] = array(); // list of the TRs in the thead
1222: - HTML2PDF::$_tables[$param['num']]['tfoot']['tr'] = array(); // list of the TRs in the tfoot
1223: - HTML2PDF::$_tables[$param['num']]['thead']['height'] = 0; // thead height
1224: - HTML2PDF::$_tables[$param['num']]['tfoot']['height'] = 0; // tfoot height
1225: - HTML2PDF::$_tables[$param['num']]['thead']['code'] = array(); // HTML content of the thead
1226: - HTML2PDF::$_tables[$param['num']]['tfoot']['code'] = array(); // HTML content of the tfoot
1227: - HTML2PDF::$_tables[$param['num']]['cols'] = array(); // properties of the COLs
1228: + $this->_tables[$param['num']] = array();
1229: + $this->_tables[$param['num']]['border'] = isset($param['border']) ? $this->parsingCss->readBorder($param['border']) : null;
1230: + $this->_tables[$param['num']]['cellpadding'] = $this->parsingCss->ConvertToMM(isset($param['cellpadding']) ? $param['cellpadding'] : '1px');
1231: + $this->_tables[$param['num']]['cellspacing'] = $this->parsingCss->ConvertToMM(isset($param['cellspacing']) ? $param['cellspacing'] : '2px');
1232: + $this->_tables[$param['num']]['cases'] = array(); // properties of each TR/TD
1233: + $this->_tables[$param['num']]['corr'] = array(); // link between TR/TD and colspan/rowspan
1234: + $this->_tables[$param['num']]['corr_x'] = 0; // position in 'cases'
1235: + $this->_tables[$param['num']]['corr_y'] = 0; // position in 'cases'
1236: + $this->_tables[$param['num']]['td_curr'] = 0; // current column
1237: + $this->_tables[$param['num']]['tr_curr'] = 0; // current row
1238: + $this->_tables[$param['num']]['curr_x'] = $this->pdf->getX();
1239: + $this->_tables[$param['num']]['curr_y'] = $this->pdf->getY();
1240: + $this->_tables[$param['num']]['width'] = 0; // global width
1241: + $this->_tables[$param['num']]['height'] = 0; // global height
1242: + $this->_tables[$param['num']]['align'] = $alignObject;
1243: + $this->_tables[$param['num']]['marge'] = array();
1244: + $this->_tables[$param['num']]['marge']['t'] = $this->parsingCss->value['padding']['t']+$this->parsingCss->value['border']['t']['width']+$this->_tables[$param['num']]['cellspacing']*0.5;
1245: + $this->_tables[$param['num']]['marge']['r'] = $this->parsingCss->value['padding']['r']+$this->parsingCss->value['border']['r']['width']+$this->_tables[$param['num']]['cellspacing']*0.5;
1246: + $this->_tables[$param['num']]['marge']['b'] = $this->parsingCss->value['padding']['b']+$this->parsingCss->value['border']['b']['width']+$this->_tables[$param['num']]['cellspacing']*0.5;
1247: + $this->_tables[$param['num']]['marge']['l'] = $this->parsingCss->value['padding']['l']+$this->parsingCss->value['border']['l']['width']+$this->_tables[$param['num']]['cellspacing']*0.5;
1248: + $this->_tables[$param['num']]['page'] = 0; // number of pages
1249: + $this->_tables[$param['num']]['new_page'] = true; // flag : new page for the current TR
1250: + $this->_tables[$param['num']]['style_value'] = null; // CSS style of the table
1251: + $this->_tables[$param['num']]['thead'] = array(); // properties on the thead
1252: + $this->_tables[$param['num']]['tfoot'] = array(); // properties on the tfoot
1253: + $this->_tables[$param['num']]['thead']['tr'] = array(); // list of the TRs in the thead
1254: + $this->_tables[$param['num']]['tfoot']['tr'] = array(); // list of the TRs in the tfoot
1255: + $this->_tables[$param['num']]['thead']['height'] = 0; // thead height
1256: + $this->_tables[$param['num']]['tfoot']['height'] = 0; // tfoot height
1257: + $this->_tables[$param['num']]['thead']['code'] = array(); // HTML content of the thead
1258: + $this->_tables[$param['num']]['tfoot']['code'] = array(); // HTML content of the tfoot
1259: + $this->_tables[$param['num']]['cols'] = array(); // properties of the COLs
1260:
1261: $this->_saveMargin($this->pdf->getlMargin(), $this->pdf->gettMargin(), $this->pdf->getrMargin());
1262:
1263: - $this->parsingCss->value['width']-= HTML2PDF::$_tables[$param['num']]['marge']['l'] + HTML2PDF::$_tables[$param['num']]['marge']['r'];
1264: + $this->parsingCss->value['width']-= $this->_tables[$param['num']]['marge']['l'] + $this->_tables[$param['num']]['marge']['r'];
1265: } else {
1266: // we start from the first page and the first page of the table
1267: - HTML2PDF::$_tables[$param['num']]['page'] = 0;
1268: - HTML2PDF::$_tables[$param['num']]['td_curr'] = 0;
1269: - HTML2PDF::$_tables[$param['num']]['tr_curr'] = 0;
1270: - HTML2PDF::$_tables[$param['num']]['td_x'] = HTML2PDF::$_tables[$param['num']]['marge']['l']+HTML2PDF::$_tables[$param['num']]['curr_x'];
1271: - HTML2PDF::$_tables[$param['num']]['td_y'] = HTML2PDF::$_tables[$param['num']]['marge']['t']+HTML2PDF::$_tables[$param['num']]['curr_y'];
1272: + $this->_tables[$param['num']]['page'] = 0;
1273: + $this->_tables[$param['num']]['td_curr'] = 0;
1274: + $this->_tables[$param['num']]['tr_curr'] = 0;
1275: + $this->_tables[$param['num']]['td_x'] = $this->_tables[$param['num']]['marge']['l']+$this->_tables[$param['num']]['curr_x'];
1276: + $this->_tables[$param['num']]['td_y'] = $this->_tables[$param['num']]['marge']['t']+$this->_tables[$param['num']]['curr_y'];
1277:
1278: // draw the borders/background of the first page/part of the table
1279: $this->_drawRectangle(
1280: - HTML2PDF::$_tables[$param['num']]['curr_x'],
1281: - HTML2PDF::$_tables[$param['num']]['curr_y'],
1282: - HTML2PDF::$_tables[$param['num']]['width'],
1283: - isset(HTML2PDF::$_tables[$param['num']]['height'][0]) ? HTML2PDF::$_tables[$param['num']]['height'][0] : null,
1284: + $this->_tables[$param['num']]['curr_x'],
1285: + $this->_tables[$param['num']]['curr_y'],
1286: + $this->_tables[$param['num']]['width'],
1287: + isset($this->_tables[$param['num']]['height'][0]) ? $this->_tables[$param['num']]['height'][0] : null,
1288: $this->parsingCss->value['border'],
1289: $this->parsingCss->value['padding'],
1290: 0,
1291: $this->parsingCss->value['background']
1292: );
1293:
1294: - HTML2PDF::$_tables[$param['num']]['style_value'] = $this->parsingCss->value;
1295: + $this->_tables[$param['num']]['style_value'] = $this->parsingCss->value;
1296: }
1297:
1298: return true;
1299: @@ -4945,79 +4958,79 @@ if (!defined('__CLASS_HTML2PDF__')) {
1300: // if we are in a sub HTML
1301: if ($this->_subPart) {
1302: // calculate the size of each case
1303: - $this->_calculateTableCellSize(HTML2PDF::$_tables[$param['num']]['cases'], HTML2PDF::$_tables[$param['num']]['corr']);
1304: + $this->_calculateTableCellSize($this->_tables[$param['num']]['cases'], $this->_tables[$param['num']]['corr']);
1305:
1306: // calculate the height of the thead and the tfoot
1307: $lst = array('thead', 'tfoot');
1308: foreach ($lst as $mode) {
1309: - HTML2PDF::$_tables[$param['num']][$mode]['height'] = 0;
1310: - foreach (HTML2PDF::$_tables[$param['num']][$mode]['tr'] as $tr) {
1311: + $this->_tables[$param['num']][$mode]['height'] = 0;
1312: + foreach ($this->_tables[$param['num']][$mode]['tr'] as $tr) {
1313: // hauteur de la ligne tr
1314: $h = 0;
1315: - for ($i=0; $i<count(HTML2PDF::$_tables[$param['num']]['cases'][$tr]); $i++)
1316: - if (HTML2PDF::$_tables[$param['num']]['cases'][$tr][$i]['rowspan']==1)
1317: - $h = max($h, HTML2PDF::$_tables[$param['num']]['cases'][$tr][$i]['h']);
1318: - HTML2PDF::$_tables[$param['num']][$mode]['height']+= $h;
1319: + for ($i=0; $i<count($this->_tables[$param['num']]['cases'][$tr]); $i++)
1320: + if ($this->_tables[$param['num']]['cases'][$tr][$i]['rowspan']==1)
1321: + $h = max($h, $this->_tables[$param['num']]['cases'][$tr][$i]['h']);
1322: + $this->_tables[$param['num']][$mode]['height']+= $h;
1323: }
1324: }
1325:
1326: // calculate the width of the table
1327: - HTML2PDF::$_tables[$param['num']]['width'] = HTML2PDF::$_tables[$param['num']]['marge']['l'] + HTML2PDF::$_tables[$param['num']]['marge']['r'];
1328: - if (isset(HTML2PDF::$_tables[$param['num']]['cases'][0])) {
1329: - foreach (HTML2PDF::$_tables[$param['num']]['cases'][0] as $case) {
1330: - HTML2PDF::$_tables[$param['num']]['width']+= $case['w'];
1331: + $this->_tables[$param['num']]['width'] = $this->_tables[$param['num']]['marge']['l'] + $this->_tables[$param['num']]['marge']['r'];
1332: + if (isset($this->_tables[$param['num']]['cases'][0])) {
1333: + foreach ($this->_tables[$param['num']]['cases'][0] as $case) {
1334: + $this->_tables[$param['num']]['width']+= $case['w'];
1335: }
1336: }
1337:
1338: // X position of the table
1339: $old = $this->parsingCss->getOldValues();
1340: $parentWidth = $old['width'] ? $old['width'] : $this->pdf->getW() - $this->pdf->getlMargin() - $this->pdf->getrMargin();
1341: - $x = HTML2PDF::$_tables[$param['num']]['curr_x'];
1342: - $w = HTML2PDF::$_tables[$param['num']]['width'];
1343: + $x = $this->_tables[$param['num']]['curr_x'];
1344: + $w = $this->_tables[$param['num']]['width'];
1345: if ($parentWidth>$w) {
1346: - if (HTML2PDF::$_tables[$param['num']]['align']=='center')
1347: + if ($this->_tables[$param['num']]['align']=='center')
1348: $x = $x + ($parentWidth-$w)*0.5;
1349: - else if (HTML2PDF::$_tables[$param['num']]['align']=='right')
1350: + else if ($this->_tables[$param['num']]['align']=='right')
1351: $x = $x + $parentWidth-$w;
1352:
1353: - HTML2PDF::$_tables[$param['num']]['curr_x'] = $x;
1354: + $this->_tables[$param['num']]['curr_x'] = $x;
1355: }
1356:
1357: // calculate the height of the table
1358: - HTML2PDF::$_tables[$param['num']]['height'] = array();
1359: + $this->_tables[$param['num']]['height'] = array();
1360:
1361: // minimum of the height because of margins, and of the thead and tfoot height
1362: - $h0 = HTML2PDF::$_tables[$param['num']]['marge']['t'] + HTML2PDF::$_tables[$param['num']]['marge']['b'];
1363: - $h0+= HTML2PDF::$_tables[$param['num']]['thead']['height'] + HTML2PDF::$_tables[$param['num']]['tfoot']['height'];
1364: + $h0 = $this->_tables[$param['num']]['marge']['t'] + $this->_tables[$param['num']]['marge']['b'];
1365: + $h0+= $this->_tables[$param['num']]['thead']['height'] + $this->_tables[$param['num']]['tfoot']['height'];
1366:
1367: // max height of the page
1368: $max = $this->pdf->getH() - $this->pdf->getbMargin();
1369:
1370: // current position on the page
1371: - $y = HTML2PDF::$_tables[$param['num']]['curr_y'];
1372: + $y = $this->_tables[$param['num']]['curr_y'];
1373: $height = $h0;
1374:
1375: // we get the height of each line
1376: - for ($k=0; $k<count(HTML2PDF::$_tables[$param['num']]['cases']); $k++) {
1377: + for ($k=0; $k<count($this->_tables[$param['num']]['cases']); $k++) {
1378:
1379: // if it is a TR of the thead or of the tfoot => skip
1380: - if (in_array($k, HTML2PDF::$_tables[$param['num']]['thead']['tr'])) continue;
1381: - if (in_array($k, HTML2PDF::$_tables[$param['num']]['tfoot']['tr'])) continue;
1382: + if (in_array($k, $this->_tables[$param['num']]['thead']['tr'])) continue;
1383: + if (in_array($k, $this->_tables[$param['num']]['tfoot']['tr'])) continue;
1384:
1385: // height of the line
1386: $th = 0;
1387: $h = 0;
1388: - for ($i=0; $i<count(HTML2PDF::$_tables[$param['num']]['cases'][$k]); $i++) {
1389: - $h = max($h, HTML2PDF::$_tables[$param['num']]['cases'][$k][$i]['h']);
1390: + for ($i=0; $i<count($this->_tables[$param['num']]['cases'][$k]); $i++) {
1391: + $h = max($h, $this->_tables[$param['num']]['cases'][$k][$i]['h']);
1392:
1393: - if (HTML2PDF::$_tables[$param['num']]['cases'][$k][$i]['rowspan']==1)
1394: - $th = max($th, HTML2PDF::$_tables[$param['num']]['cases'][$k][$i]['h']);
1395: + if ($this->_tables[$param['num']]['cases'][$k][$i]['rowspan']==1)
1396: + $th = max($th, $this->_tables[$param['num']]['cases'][$k][$i]['h']);
1397: }
1398:
1399: // if the row does not fit on the page => new page
1400: if ($y+$h+$height>$max) {
1401: if ($height==$h0) $height = null;
1402: - HTML2PDF::$_tables[$param['num']]['height'][] = $height;
1403: + $this->_tables[$param['num']]['height'][] = $height;
1404: $height = $h0;
1405: $y = $this->_margeTop;
1406: }
1407: @@ -5025,37 +5038,37 @@ if (!defined('__CLASS_HTML2PDF__')) {
1408: }
1409:
1410: // if ther is a height at the end, add it
1411: - if ($height!=$h0 || $k==0) HTML2PDF::$_tables[$param['num']]['height'][] = $height;
1412: + if ($height!=$h0 || $k==0) $this->_tables[$param['num']]['height'][] = $height;
1413: } else {
1414: // if we have tfoor, draw it
1415: - if (count(HTML2PDF::$_tables[$param['num']]['tfoot']['code'])) {
1416: - $tmpTR = HTML2PDF::$_tables[$param['num']]['tr_curr'];
1417: - $tmpTD = HTML2PDF::$_tables[$param['num']]['td_curr'];
1418: + if (count($this->_tables[$param['num']]['tfoot']['code'])) {
1419: + $tmpTR = $this->_tables[$param['num']]['tr_curr'];
1420: + $tmpTD = $this->_tables[$param['num']]['td_curr'];
1421: $oldParsePos = $this->_parsePos;
1422: $oldParseCode = $this->parsingHtml->code;
1423:
1424: - HTML2PDF::$_tables[$param['num']]['tr_curr'] = HTML2PDF::$_tables[$param['num']]['tfoot']['tr'][0];
1425: - HTML2PDF::$_tables[$param['num']]['td_curr'] = 0;
1426: + $this->_tables[$param['num']]['tr_curr'] = $this->_tables[$param['num']]['tfoot']['tr'][0];
1427: + $this->_tables[$param['num']]['td_curr'] = 0;
1428: $this->_parsePos = 0;
1429: - $this->parsingHtml->code = HTML2PDF::$_tables[$param['num']]['tfoot']['code'];
1430: + $this->parsingHtml->code = $this->_tables[$param['num']]['tfoot']['code'];
1431: $this->_isInTfoot = true;
1432: $this->_makeHTMLcode();
1433: $this->_isInTfoot = false;
1434:
1435: $this->_parsePos = $oldParsePos;
1436: $this->parsingHtml->code = $oldParseCode;
1437: - HTML2PDF::$_tables[$param['num']]['tr_curr'] = $tmpTR;
1438: - HTML2PDF::$_tables[$param['num']]['td_curr'] = $tmpTD;
1439: + $this->_tables[$param['num']]['tr_curr'] = $tmpTR;
1440: + $this->_tables[$param['num']]['td_curr'] = $tmpTD;
1441: }
1442:
1443: // get the positions of the end of the table
1444: - $x = HTML2PDF::$_tables[$param['num']]['curr_x'] + HTML2PDF::$_tables[$param['num']]['width'];
1445: - if (count(HTML2PDF::$_tables[$param['num']]['height'])>1)
1446: - $y = $this->_margeTop+HTML2PDF::$_tables[$param['num']]['height'][count(HTML2PDF::$_tables[$param['num']]['height'])-1];
1447: - else if (count(HTML2PDF::$_tables[$param['num']]['height'])==1)
1448: - $y = HTML2PDF::$_tables[$param['num']]['curr_y']+HTML2PDF::$_tables[$param['num']]['height'][count(HTML2PDF::$_tables[$param['num']]['height'])-1];
1449: + $x = $this->_tables[$param['num']]['curr_x'] + $this->_tables[$param['num']]['width'];
1450: + if (count($this->_tables[$param['num']]['height'])>1)
1451: + $y = $this->_margeTop+$this->_tables[$param['num']]['height'][count($this->_tables[$param['num']]['height'])-1];
1452: + else if (count($this->_tables[$param['num']]['height'])==1)
1453: + $y = $this->_tables[$param['num']]['curr_y']+$this->_tables[$param['num']]['height'][count($this->_tables[$param['num']]['height'])-1];
1454: else
1455: - $y = HTML2PDF::$_tables[$param['num']]['curr_y'];
1456: + $y = $this->_tables[$param['num']]['curr_y'];
1457:
1458: $this->_maxX = max($this->_maxX, $x);
1459: $this->_maxY = max($this->_maxY, $y);
1460: @@ -5085,7 +5098,7 @@ if (!defined('__CLASS_HTML2PDF__')) {
1461: {
1462: $span = isset($param['span']) ? $param['span'] : 1;
1463: for ($k=0; $k<$span; $k++)
1464: - HTML2PDF::$_tables[$param['num']]['cols'][] = $param;
1465: + $this->_tables[$param['num']]['cols'][] = $param;
1466: }
1467:
1468: /**
1469: @@ -5121,67 +5134,67 @@ if (!defined('__CLASS_HTML2PDF__')) {
1470: $this->parsingCss->fontSet();
1471:
1472: // position in the table
1473: - HTML2PDF::$_tables[$param['num']]['tr_curr']++;
1474: - HTML2PDF::$_tables[$param['num']]['td_curr']= 0;
1475: + $this->_tables[$param['num']]['tr_curr']++;
1476: + $this->_tables[$param['num']]['td_curr']= 0;
1477:
1478: // if we are not in a sub html
1479: if (!$this->_subPart) {
1480:
1481: // Y after the row
1482: $ty=null;
1483: - for ($ii=0; $ii<count(HTML2PDF::$_tables[$param['num']]['cases'][HTML2PDF::$_tables[$param['num']]['tr_curr']-1]); $ii++) {
1484: - $ty = max($ty, HTML2PDF::$_tables[$param['num']]['cases'][HTML2PDF::$_tables[$param['num']]['tr_curr']-1][$ii]['h']);
1485: + for ($ii=0; $ii<count($this->_tables[$param['num']]['cases'][$this->_tables[$param['num']]['tr_curr']-1]); $ii++) {
1486: + $ty = max($ty, $this->_tables[$param['num']]['cases'][$this->_tables[$param['num']]['tr_curr']-1][$ii]['h']);
1487: }
1488:
1489: // height of the tfoot
1490: - $hfoot = HTML2PDF::$_tables[$param['num']]['tfoot']['height'];
1491: + $hfoot = $this->_tables[$param['num']]['tfoot']['height'];
1492:
1493: // if the line does not fit on the page => new page
1494: - if (!$this->_isInTfoot && HTML2PDF::$_tables[$param['num']]['td_y'] + HTML2PDF::$_tables[$param['num']]['marge']['b'] + $ty +$hfoot> $this->pdf->getH() - $this->pdf->getbMargin()) {
1495: + if (!$this->_isInTfoot && $this->_tables[$param['num']]['td_y'] + $this->_tables[$param['num']]['marge']['b'] + $ty +$hfoot> $this->pdf->getH() - $this->pdf->getbMargin()) {
1496:
1497: // fi ther is a tfoot => draw it
1498: - if (count(HTML2PDF::$_tables[$param['num']]['tfoot']['code'])) {
1499: - $tmpTR = HTML2PDF::$_tables[$param['num']]['tr_curr'];
1500: - $tmpTD = HTML2PDF::$_tables[$param['num']]['td_curr'];
1501: + if (count($this->_tables[$param['num']]['tfoot']['code'])) {
1502: + $tmpTR = $this->_tables[$param['num']]['tr_curr'];
1503: + $tmpTD = $this->_tables[$param['num']]['td_curr'];
1504: $oldParsePos = $this->_parsePos;
1505: $oldParseCode = $this->parsingHtml->code;
1506:
1507: - HTML2PDF::$_tables[$param['num']]['tr_curr'] = HTML2PDF::$_tables[$param['num']]['tfoot']['tr'][0];
1508: - HTML2PDF::$_tables[$param['num']]['td_curr'] = 0;
1509: + $this->_tables[$param['num']]['tr_curr'] = $this->_tables[$param['num']]['tfoot']['tr'][0];
1510: + $this->_tables[$param['num']]['td_curr'] = 0;
1511: $this->_parsePos = 0;
1512: - $this->parsingHtml->code = HTML2PDF::$_tables[$param['num']]['tfoot']['code'];
1513: + $this->parsingHtml->code = $this->_tables[$param['num']]['tfoot']['code'];
1514: $this->_isInTfoot = true;
1515: $this->_makeHTMLcode();
1516: $this->_isInTfoot = false;
1517:
1518: $this->_parsePos = $oldParsePos;
1519: $this->parsingHtml->code = $oldParseCode;
1520: - HTML2PDF::$_tables[$param['num']]['tr_curr'] = $tmpTR;
1521: - HTML2PDF::$_tables[$param['num']]['td_curr'] = $tmpTD;
1522: + $this->_tables[$param['num']]['tr_curr'] = $tmpTR;
1523: + $this->_tables[$param['num']]['td_curr'] = $tmpTD;
1524: }
1525:
1526: // new page
1527: - HTML2PDF::$_tables[$param['num']]['new_page'] = true;
1528: + $this->_tables[$param['num']]['new_page'] = true;
1529: $this->_setNewPage();
1530:
1531: // new position
1532: - HTML2PDF::$_tables[$param['num']]['page']++;
1533: - HTML2PDF::$_tables[$param['num']]['curr_y'] = $this->pdf->getY();
1534: - HTML2PDF::$_tables[$param['num']]['td_y'] = HTML2PDF::$_tables[$param['num']]['curr_y']+HTML2PDF::$_tables[$param['num']]['marge']['t'];
1535: + $this->_tables[$param['num']]['page']++;
1536: + $this->_tables[$param['num']]['curr_y'] = $this->pdf->getY();
1537: + $this->_tables[$param['num']]['td_y'] = $this->_tables[$param['num']]['curr_y']+$this->_tables[$param['num']]['marge']['t'];
1538:
1539: // if we have the height of the tbale on the page => draw borders and background
1540: - if (isset(HTML2PDF::$_tables[$param['num']]['height'][HTML2PDF::$_tables[$param['num']]['page']])) {
1541: + if (isset($this->_tables[$param['num']]['height'][$this->_tables[$param['num']]['page']])) {
1542: $old = $this->parsingCss->value;
1543: - $this->parsingCss->value = HTML2PDF::$_tables[$param['num']]['style_value'];
1544: + $this->parsingCss->value = $this->_tables[$param['num']]['style_value'];
1545:
1546: $this->_drawRectangle(
1547: - HTML2PDF::$_tables[$param['num']]['curr_x'],
1548: - HTML2PDF::$_tables[$param['num']]['curr_y'],
1549: - HTML2PDF::$_tables[$param['num']]['width'],
1550: - HTML2PDF::$_tables[$param['num']]['height'][HTML2PDF::$_tables[$param['num']]['page']],
1551: + $this->_tables[$param['num']]['curr_x'],
1552: + $this->_tables[$param['num']]['curr_y'],
1553: + $this->_tables[$param['num']]['width'],
1554: + $this->_tables[$param['num']]['height'][$this->_tables[$param['num']]['page']],
1555: $this->parsingCss->value['border'],
1556: $this->parsingCss->value['padding'],
1557: - HTML2PDF::$_tables[$param['num']]['cellspacing']*0.5,
1558: + $this->_tables[$param['num']]['cellspacing']*0.5,
1559: $this->parsingCss->value['background']
1560: );
1561:
1562: @@ -5190,37 +5203,37 @@ if (!defined('__CLASS_HTML2PDF__')) {
1563: }
1564:
1565: // if we are in a new page, and if we have a thead => draw it
1566: - if (HTML2PDF::$_tables[$param['num']]['new_page'] && count(HTML2PDF::$_tables[$param['num']]['thead']['code'])) {
1567: - HTML2PDF::$_tables[$param['num']]['new_page'] = false;
1568: - $tmpTR = HTML2PDF::$_tables[$param['num']]['tr_curr'];
1569: - $tmpTD = HTML2PDF::$_tables[$param['num']]['td_curr'];
1570: + if ($this->_tables[$param['num']]['new_page'] && count($this->_tables[$param['num']]['thead']['code'])) {
1571: + $this->_tables[$param['num']]['new_page'] = false;
1572: + $tmpTR = $this->_tables[$param['num']]['tr_curr'];
1573: + $tmpTD = $this->_tables[$param['num']]['td_curr'];
1574: $oldParsePos = $this->_parsePos;
1575: $oldParseCode = $this->parsingHtml->code;
1576:
1577: - HTML2PDF::$_tables[$param['num']]['tr_curr'] = HTML2PDF::$_tables[$param['num']]['thead']['tr'][0];
1578: - HTML2PDF::$_tables[$param['num']]['td_curr'] = 0;
1579: + $this->_tables[$param['num']]['tr_curr'] = $this->_tables[$param['num']]['thead']['tr'][0];
1580: + $this->_tables[$param['num']]['td_curr'] = 0;
1581: $this->_parsePos = 0;
1582: - $this->parsingHtml->code = HTML2PDF::$_tables[$param['num']]['thead']['code'];
1583: + $this->parsingHtml->code = $this->_tables[$param['num']]['thead']['code'];
1584: $this->_isInThead = true;
1585: $this->_makeHTMLcode();
1586: $this->_isInThead = false;
1587:
1588: $this->_parsePos = $oldParsePos;
1589: $this->parsingHtml->code = $oldParseCode;
1590: - HTML2PDF::$_tables[$param['num']]['tr_curr'] = $tmpTR;
1591: - HTML2PDF::$_tables[$param['num']]['td_curr'] = $tmpTD;
1592: - HTML2PDF::$_tables[$param['num']]['new_page'] = true;
1593: + $this->_tables[$param['num']]['tr_curr'] = $tmpTR;
1594: + $this->_tables[$param['num']]['td_curr'] = $tmpTD;
1595: + $this->_tables[$param['num']]['new_page'] = true;
1596: }
1597: // else (in a sub HTML)
1598: } else {
1599: // prepare it
1600: - HTML2PDF::$_tables[$param['num']]['cases'][HTML2PDF::$_tables[$param['num']]['tr_curr']-1] = array();
1601: - if (!isset(HTML2PDF::$_tables[$param['num']]['corr'][HTML2PDF::$_tables[$param['num']]['corr_y']]))
1602: - HTML2PDF::$_tables[$param['num']]['corr'][HTML2PDF::$_tables[$param['num']]['corr_y']] = array();
1603: -
1604: - HTML2PDF::$_tables[$param['num']]['corr_x']=0;
1605: - while(isset(HTML2PDF::$_tables[$param['num']]['corr'][HTML2PDF::$_tables[$param['num']]['corr_y']][HTML2PDF::$_tables[$param['num']]['corr_x']]))
1606: - HTML2PDF::$_tables[$param['num']]['corr_x']++;
1607: + $this->_tables[$param['num']]['cases'][$this->_tables[$param['num']]['tr_curr']-1] = array();
1608: + if (!isset($this->_tables[$param['num']]['corr'][$this->_tables[$param['num']]['corr_y']]))
1609: + $this->_tables[$param['num']]['corr'][$this->_tables[$param['num']]['corr_y']] = array();
1610: +
1611: + $this->_tables[$param['num']]['corr_x']=0;
1612: + while(isset($this->_tables[$param['num']]['corr'][$this->_tables[$param['num']]['corr_y']][$this->_tables[$param['num']]['corr_x']]))
1613: + $this->_tables[$param['num']]['corr_x']++;
1614: }
1615:
1616: return true;
1617: @@ -5247,18 +5260,18 @@ if (!defined('__CLASS_HTML2PDF__')) {
1618:
1619: // Y of the current line
1620: $ty=null;
1621: - for ($ii=0; $ii<count(HTML2PDF::$_tables[$param['num']]['cases'][HTML2PDF::$_tables[$param['num']]['tr_curr']-1]); $ii++) {
1622: - if (HTML2PDF::$_tables[$param['num']]['cases'][HTML2PDF::$_tables[$param['num']]['tr_curr']-1][$ii]['rowspan']==1) {
1623: - $ty = HTML2PDF::$_tables[$param['num']]['cases'][HTML2PDF::$_tables[$param['num']]['tr_curr']-1][$ii]['h'];
1624: + for ($ii=0; $ii<count($this->_tables[$param['num']]['cases'][$this->_tables[$param['num']]['tr_curr']-1]); $ii++) {
1625: + if ($this->_tables[$param['num']]['cases'][$this->_tables[$param['num']]['tr_curr']-1][$ii]['rowspan']==1) {
1626: + $ty = $this->_tables[$param['num']]['cases'][$this->_tables[$param['num']]['tr_curr']-1][$ii]['h'];
1627: }
1628: }
1629:
1630: // new position
1631: - HTML2PDF::$_tables[$param['num']]['td_x'] = HTML2PDF::$_tables[$param['num']]['curr_x']+HTML2PDF::$_tables[$param['num']]['marge']['l'];
1632: - HTML2PDF::$_tables[$param['num']]['td_y']+= $ty;
1633: - HTML2PDF::$_tables[$param['num']]['new_page'] = false;
1634: + $this->_tables[$param['num']]['td_x'] = $this->_tables[$param['num']]['curr_x']+$this->_tables[$param['num']]['marge']['l'];
1635: + $this->_tables[$param['num']]['td_y']+= $ty;
1636: + $this->_tables[$param['num']]['new_page'] = false;
1637: } else {
1638: - HTML2PDF::$_tables[$param['num']]['corr_y']++;
1639: + $this->_tables[$param['num']]['corr_y']++;
1640: }
1641:
1642: return true;
1643: @@ -5277,8 +5290,8 @@ if (!defined('__CLASS_HTML2PDF__')) {
1644:
1645: $this->_maxH = 0;
1646:
1647: - $param['cellpadding'] = HTML2PDF::$_tables[$param['num']]['cellpadding'].'mm';
1648: - $param['cellspacing'] = HTML2PDF::$_tables[$param['num']]['cellspacing'].'mm';
1649: + $param['cellpadding'] = $this->_tables[$param['num']]['cellpadding'].'mm';
1650: + $param['cellspacing'] = $this->_tables[$param['num']]['cellspacing'].'mm';
1651:
1652: // specific style for LI
1653: if ($other=='li') {
1654: @@ -5296,8 +5309,8 @@ if (!defined('__CLASS_HTML2PDF__')) {
1655: }
1656:
1657: // get the properties of the TD
1658: - $x = HTML2PDF::$_tables[$param['num']]['td_curr'];
1659: - $y = HTML2PDF::$_tables[$param['num']]['tr_curr']-1;
1660: + $x = $this->_tables[$param['num']]['td_curr'];
1661: + $y = $this->_tables[$param['num']]['tr_curr']-1;
1662: $colspan = isset($param['colspan']) ? $param['colspan'] : 1;
1663: $rowspan = isset($param['rowspan']) ? $param['rowspan'] : 1;
1664:
1665: @@ -5307,18 +5320,18 @@ if (!defined('__CLASS_HTML2PDF__')) {
1666: // specific traitment for TD and TH
1667: if (in_array($other, array('td', 'th'))) {
1668: // id of the column
1669: - $numCol = isset(HTML2PDF::$_tables[$param['num']]['cases'][$y][$x]['Xr']) ? HTML2PDF::$_tables[$param['num']]['cases'][$y][$x]['Xr'] : HTML2PDF::$_tables[$param['num']]['corr_x'];
1670: + $numCol = isset($this->_tables[$param['num']]['cases'][$y][$x]['Xr']) ? $this->_tables[$param['num']]['cases'][$y][$x]['Xr'] : $this->_tables[$param['num']]['corr_x'];
1671:
1672: // we get the properties of the COL tag, if exist
1673: - if (isset(HTML2PDF::$_tables[$param['num']]['cols'][$numCol])) {
1674: + if (isset($this->_tables[$param['num']]['cols'][$numCol])) {
1675:
1676: - $colParam = HTML2PDF::$_tables[$param['num']]['cols'][$numCol];
1677: + $colParam = $this->_tables[$param['num']]['cols'][$numCol];
1678:
1679: // for colspans => we get all the neede widths
1680: $colParam['style']['width'] = array();
1681: for ($k=0; $k<$colspan; $k++) {
1682: - if (isset(HTML2PDF::$_tables[$param['num']]['cols'][$numCol+$k]['style']['width'])) {
1683: - $colParam['style']['width'][] = HTML2PDF::$_tables[$param['num']]['cols'][$numCol+$k]['style']['width'];
1684: + if (isset($this->_tables[$param['num']]['cols'][$numCol+$k]['style']['width'])) {
1685: + $colParam['style']['width'][] = $this->_tables[$param['num']]['cols'][$numCol+$k]['style']['width'];
1686: }
1687: }
1688:
1689: @@ -5366,12 +5379,12 @@ if (!defined('__CLASS_HTML2PDF__')) {
1690: if ($old && ($old['color'] || $old['image']))
1691: $legacy['background'] = $old;
1692:
1693: - if (HTML2PDF::$_tables[$param['num']]['border']) {
1694: + if ($this->_tables[$param['num']]['border']) {
1695: $legacy['border'] = array();
1696: - $legacy['border']['l'] = HTML2PDF::$_tables[$param['num']]['border'];
1697: - $legacy['border']['t'] = HTML2PDF::$_tables[$param['num']]['border'];
1698: - $legacy['border']['r'] = HTML2PDF::$_tables[$param['num']]['border'];
1699: - $legacy['border']['b'] = HTML2PDF::$_tables[$param['num']]['border'];
1700: + $legacy['border']['l'] = $this->_tables[$param['num']]['border'];
1701: + $legacy['border']['t'] = $this->_tables[$param['num']]['border'];
1702: + $legacy['border']['r'] = $this->_tables[$param['num']]['border'];
1703: + $legacy['border']['b'] = $this->_tables[$param['num']]['border'];
1704: }
1705: }
1706: $return = $this->parsingCss->analyse($other, $param, $legacy);
1707: @@ -5387,14 +5400,14 @@ if (!defined('__CLASS_HTML2PDF__')) {
1708: if ($collapse) {
1709: if (!$this->_subPart) {
1710: if (
1711: - (HTML2PDF::$_tables[$param['num']]['tr_curr']>1 && !HTML2PDF::$_tables[$param['num']]['new_page']) ||
1712: - (!$this->_isInThead && count(HTML2PDF::$_tables[$param['num']]['thead']['code']))
1713: + ($this->_tables[$param['num']]['tr_curr']>1 && !$this->_tables[$param['num']]['new_page']) ||
1714: + (!$this->_isInThead && count($this->_tables[$param['num']]['thead']['code']))
1715: ) {
1716: $this->parsingCss->value['border']['t'] = $this->parsingCss->readBorder('none');
1717: }
1718: }
1719:
1720: - if (HTML2PDF::$_tables[$param['num']]['td_curr']>0) {
1721: + if ($this->_tables[$param['num']]['td_curr']>0) {
1722: if (!$return) $this->parsingCss->value['width']+= $this->parsingCss->value['border']['l']['width'];
1723: $this->parsingCss->value['border']['l'] = $this->parsingCss->readBorder('none');
1724: }
1725: @@ -5402,35 +5415,35 @@ if (!defined('__CLASS_HTML2PDF__')) {
1726:
1727: // margins of the table
1728: $marge = array();
1729: - $marge['t'] = $this->parsingCss->value['padding']['t']+0.5*HTML2PDF::$_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['t']['width'];
1730: - $marge['r'] = $this->parsingCss->value['padding']['r']+0.5*HTML2PDF::$_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['r']['width'];
1731: - $marge['b'] = $this->parsingCss->value['padding']['b']+0.5*HTML2PDF::$_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['b']['width'];
1732: - $marge['l'] = $this->parsingCss->value['padding']['l']+0.5*HTML2PDF::$_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['l']['width'];
1733: + $marge['t'] = $this->parsingCss->value['padding']['t']+0.5*$this->_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['t']['width'];
1734: + $marge['r'] = $this->parsingCss->value['padding']['r']+0.5*$this->_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['r']['width'];
1735: + $marge['b'] = $this->parsingCss->value['padding']['b']+0.5*$this->_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['b']['width'];
1736: + $marge['l'] = $this->parsingCss->value['padding']['l']+0.5*$this->_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['l']['width'];
1737:
1738: // if we are in a sub HTML
1739: if ($this->_subPart) {
1740: // new position in the table
1741: - HTML2PDF::$_tables[$param['num']]['td_curr']++;
1742: - HTML2PDF::$_tables[$param['num']]['cases'][$y][$x] = array();
1743: - HTML2PDF::$_tables[$param['num']]['cases'][$y][$x]['w'] = 0;
1744: - HTML2PDF::$_tables[$param['num']]['cases'][$y][$x]['h'] = 0;
1745: - HTML2PDF::$_tables[$param['num']]['cases'][$y][$x]['dw'] = 0;
1746: - HTML2PDF::$_tables[$param['num']]['cases'][$y][$x]['colspan'] = $colspan;
1747: - HTML2PDF::$_tables[$param['num']]['cases'][$y][$x]['rowspan'] = $rowspan;
1748: - HTML2PDF::$_tables[$param['num']]['cases'][$y][$x]['Xr'] = HTML2PDF::$_tables[$param['num']]['corr_x'];
1749: - HTML2PDF::$_tables[$param['num']]['cases'][$y][$x]['Yr'] = HTML2PDF::$_tables[$param['num']]['corr_y'];
1750: + $this->_tables[$param['num']]['td_curr']++;
1751: + $this->_tables[$param['num']]['cases'][$y][$x] = array();
1752: + $this->_tables[$param['num']]['cases'][$y][$x]['w'] = 0;
1753: + $this->_tables[$param['num']]['cases'][$y][$x]['h'] = 0;
1754: + $this->_tables[$param['num']]['cases'][$y][$x]['dw'] = 0;
1755: + $this->_tables[$param['num']]['cases'][$y][$x]['colspan'] = $colspan;
1756: + $this->_tables[$param['num']]['cases'][$y][$x]['rowspan'] = $rowspan;
1757: + $this->_tables[$param['num']]['cases'][$y][$x]['Xr'] = $this->_tables[$param['num']]['corr_x'];
1758: + $this->_tables[$param['num']]['cases'][$y][$x]['Yr'] = $this->_tables[$param['num']]['corr_y'];
1759:
1760: // prepare the mapping for rowspan and colspan
1761: for ($j=0; $j<$rowspan; $j++) {
1762: for ($i=0; $i<$colspan; $i++) {
1763: - HTML2PDF::$_tables[$param['num']]['corr']
1764: - [HTML2PDF::$_tables[$param['num']]['corr_y']+$j]
1765: - [HTML2PDF::$_tables[$param['num']]['corr_x']+$i] = ($i+$j>0) ? '' : array($x,$y,$colspan,$rowspan);
1766: + $this->_tables[$param['num']]['corr']
1767: + [$this->_tables[$param['num']]['corr_y']+$j]
1768: + [$this->_tables[$param['num']]['corr_x']+$i] = ($i+$j>0) ? '' : array($x,$y,$colspan,$rowspan);
1769: }
1770: }
1771: - HTML2PDF::$_tables[$param['num']]['corr_x']+= $colspan;
1772: - while (isset(HTML2PDF::$_tables[$param['num']]['corr'][HTML2PDF::$_tables[$param['num']]['corr_y']][HTML2PDF::$_tables[$param['num']]['corr_x']])) {
1773: - HTML2PDF::$_tables[$param['num']]['corr_x']++;
1774: + $this->_tables[$param['num']]['corr_x']+= $colspan;
1775: + while (isset($this->_tables[$param['num']]['corr'][$this->_tables[$param['num']]['corr_y']][$this->_tables[$param['num']]['corr_x']])) {
1776: + $this->_tables[$param['num']]['corr_x']++;
1777: }
1778:
1779: // extract the content of the TD, and calculate his size
1780: @@ -5441,31 +5454,31 @@ if (!defined('__CLASS_HTML2PDF__')) {
1781: $this->_tempPos+= count($level);
1782: } else {
1783: // new position in the table
1784: - HTML2PDF::$_tables[$param['num']]['td_curr']++;
1785: - HTML2PDF::$_tables[$param['num']]['td_x']+= HTML2PDF::$_tables[$param['num']]['cases'][$y][$x]['dw'];
1786: + $this->_tables[$param['num']]['td_curr']++;
1787: + $this->_tables[$param['num']]['td_x']+= $this->_tables[$param['num']]['cases'][$y][$x]['dw'];
1788:
1789: // borders and background of the TD
1790: $this->_drawRectangle(
1791: - HTML2PDF::$_tables[$param['num']]['td_x'],
1792: - HTML2PDF::$_tables[$param['num']]['td_y'],
1793: - HTML2PDF::$_tables[$param['num']]['cases'][$y][$x]['w'],
1794: - HTML2PDF::$_tables[$param['num']]['cases'][$y][$x]['h'],
1795: + $this->_tables[$param['num']]['td_x'],
1796: + $this->_tables[$param['num']]['td_y'],
1797: + $this->_tables[$param['num']]['cases'][$y][$x]['w'],
1798: + $this->_tables[$param['num']]['cases'][$y][$x]['h'],
1799: $this->parsingCss->value['border'],
1800: $this->parsingCss->value['padding'],
1801: - HTML2PDF::$_tables[$param['num']]['cellspacing']*0.5,
1802: + $this->_tables[$param['num']]['cellspacing']*0.5,
1803: $this->parsingCss->value['background']
1804: );
1805:
1806: - $this->parsingCss->value['width'] = HTML2PDF::$_tables[$param['num']]['cases'][$y][$x]['w'] - $marge['l'] - $marge['r'];
1807: + $this->parsingCss->value['width'] = $this->_tables[$param['num']]['cases'][$y][$x]['w'] - $marge['l'] - $marge['r'];
1808:
1809: // marges = size of the TD
1810: - $mL = HTML2PDF::$_tables[$param['num']]['td_x']+$marge['l'];
1811: + $mL = $this->_tables[$param['num']]['td_x']+$marge['l'];
1812: $mR = $this->pdf->getW() - $mL - $this->parsingCss->value['width'];
1813: $this->_saveMargin($mL, 0, $mR);
1814:
1815: // position of the content, from vertical-align
1816: - $hCorr = HTML2PDF::$_tables[$param['num']]['cases'][$y][$x]['h'];
1817: - $hReel = HTML2PDF::$_tables[$param['num']]['cases'][$y][$x]['real_h'];
1818: + $hCorr = $this->_tables[$param['num']]['cases'][$y][$x]['h'];
1819: + $hReel = $this->_tables[$param['num']]['cases'][$y][$x]['real_h'];
1820: switch($this->parsingCss->value['vertical-align'])
1821: {
1822: case 'bottom':
1823: @@ -5483,8 +5496,8 @@ if (!defined('__CLASS_HTML2PDF__')) {
1824: }
1825:
1826: // position of the content
1827: - $x = HTML2PDF::$_tables[$param['num']]['td_x']+$marge['l'];
1828: - $y = HTML2PDF::$_tables[$param['num']]['td_y']+$marge['t']+$yCorr;
1829: + $x = $this->_tables[$param['num']]['td_x']+$marge['l'];
1830: + $y = $this->_tables[$param['num']]['td_y']+$marge['t']+$yCorr;
1831: $this->pdf->setXY($x, $y);
1832: $this->_setNewPositionForNewLine();
1833: }
1834: @@ -5507,10 +5520,10 @@ if (!defined('__CLASS_HTML2PDF__')) {
1835:
1836: // get the margins
1837: $marge = array();
1838: - $marge['t'] = $this->parsingCss->value['padding']['t']+0.5*HTML2PDF::$_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['t']['width'];
1839: - $marge['r'] = $this->parsingCss->value['padding']['r']+0.5*HTML2PDF::$_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['r']['width'];
1840: - $marge['b'] = $this->parsingCss->value['padding']['b']+0.5*HTML2PDF::$_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['b']['width'];
1841: - $marge['l'] = $this->parsingCss->value['padding']['l']+0.5*HTML2PDF::$_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['l']['width'];
1842: + $marge['t'] = $this->parsingCss->value['padding']['t']+0.5*$this->_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['t']['width'];
1843: + $marge['r'] = $this->parsingCss->value['padding']['r']+0.5*$this->_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['r']['width'];
1844: + $marge['b'] = $this->parsingCss->value['padding']['b']+0.5*$this->_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['b']['width'];
1845: + $marge['l'] = $this->parsingCss->value['padding']['l']+0.5*$this->_tables[$param['num']]['cellspacing']+$this->parsingCss->value['border']['l']['width'];
1846: $marge['t']+= 0.001;
1847: $marge['r']+= 0.001;
1848: $marge['b']+= 0.001;
1849: @@ -5533,19 +5546,19 @@ if (!defined('__CLASS_HTML2PDF__')) {
1850: $h2 = $this->parsingCss->value['height'] + $marge['t'] + $marge['b'];
1851:
1852: // final size of the TD
1853: - HTML2PDF::$_tables[$param['num']]['cases'][HTML2PDF::$_tables[$param['num']]['tr_curr']-1][HTML2PDF::$_tables[$param['num']]['td_curr']-1]['w'] = max(array($w0, $w2));
1854: - HTML2PDF::$_tables[$param['num']]['cases'][HTML2PDF::$_tables[$param['num']]['tr_curr']-1][HTML2PDF::$_tables[$param['num']]['td_curr']-1]['h'] = max(array($h0, $h2));
1855: + $this->_tables[$param['num']]['cases'][$this->_tables[$param['num']]['tr_curr']-1][$this->_tables[$param['num']]['td_curr']-1]['w'] = max(array($w0, $w2));
1856: + $this->_tables[$param['num']]['cases'][$this->_tables[$param['num']]['tr_curr']-1][$this->_tables[$param['num']]['td_curr']-1]['h'] = max(array($h0, $h2));
1857:
1858: // real position of the content
1859: - HTML2PDF::$_tables[$param['num']]['cases'][HTML2PDF::$_tables[$param['num']]['tr_curr']-1][HTML2PDF::$_tables[$param['num']]['td_curr']-1]['real_w'] = $w0;
1860: - HTML2PDF::$_tables[$param['num']]['cases'][HTML2PDF::$_tables[$param['num']]['tr_curr']-1][HTML2PDF::$_tables[$param['num']]['td_curr']-1]['real_h'] = $h0;
1861: + $this->_tables[$param['num']]['cases'][$this->_tables[$param['num']]['tr_curr']-1][$this->_tables[$param['num']]['td_curr']-1]['real_w'] = $w0;
1862: + $this->_tables[$param['num']]['cases'][$this->_tables[$param['num']]['tr_curr']-1][$this->_tables[$param['num']]['td_curr']-1]['real_h'] = $h0;
1863:
1864: // destroy the sub HTML
1865: $this->_destroySubHTML($this->_subHtml);
1866: } else {
1867: $this->_loadMargin();
1868:
1869: - HTML2PDF::$_tables[$param['num']]['td_x']+= HTML2PDF::$_tables[$param['num']]['cases'][HTML2PDF::$_tables[$param['num']]['tr_curr']-1][HTML2PDF::$_tables[$param['num']]['td_curr']-1]['w'];
1870: + $this->_tables[$param['num']]['td_x']+= $this->_tables[$param['num']]['cases'][$this->_tables[$param['num']]['tr_curr']-1][$this->_tables[$param['num']]['td_curr']-1]['w'];
1871: }
1872:
1873: $this->parsingCss->load();
1874: @@ -6485,4 +6498,4 @@ if (!defined('__CLASS_HTML2PDF__')) {
1875: }
1876:
1877: }
1878: -}
1879: \ No newline at end of file
1880: +}